yii2-jui
yii2-jui copied to clipboard
$.fn.button.noConflict is not a function
What steps will reproduce the problem?
What's expected?
What do you get instead?
Additional info
| Q | A |
|---|---|
| Yii vesion | 2.0.11.2. |
| PHP version | 5.5.9-1ubuntu4.21 |
| Operating system | ubuntu4.21 |

Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
- When does the issue occur?
- What do you see?
- What was the expected result?
- Can you supply us with a stacktrace? (optional)
- Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)
Thanks!
This is an automated comment, triggered by adding the label status:need more info.
Dialog::begin([
'clientOptions' => [
'modal' => true,
],
]);
echo 'Dialog contents here...';
Dialog::end();
TypeError: $.fn.button.noConflict is not a function
@samdark Same problem with Yii2 version 2.0.15-dev. With Bootstrap and Dialog of JUI.
Solution is add .noConflict in \vendor\yiisoft\yii2-jui\src\Dialog.php at line 45
if ($.fn.button.noConflict) { var bootstrapButton = $.fn.button.noConflict(); $.fn.bootstrapBtn = bootstrapButton; }",
After upgrade to newest jQuery, UI, bootstrap I am receiving error with modal Dialog grid page:
TypeError: $.fn.button.noConflict is not a function
changing the line to:
if ($.fn.button && $.fn.button.noConflict !== undefined) {
...
}
does not break JS code even if method noConflict() would be removed from the button object.
Though I am not sure whether this would be perfect solution ..
After change these line, it works...! Thanks a lot
我也是这个问题,为什么这个bug还没修复
@haohetao because you didn't provide a PR yet :)
I had the same issue and solved it with MuvShots repository. I think yiisoft/yii2-jui should be fixed too.
Issue still there. Main repo should be updated
I guess whole CI build needs to be reviewed, coz all builds fail for long ago fixed issues e.g.
- 7.4 - Cannot use 'Object' as class name as it is reserved in /home/travis/build/yiisoft/yii2-jui/vendor/yiisoft/yii2/base/Object.php on line 77
- 7.1 - There should be the jQuery UI Selectable plugin initialization for myselectableitems
The fix itself should not cause any failures. Since I am not familiar with these builds I am not sure how to fix it.
Yes, we should switch to GitHub actions.