yii2-jui icon indicating copy to clipboard operation
yii2-jui copied to clipboard

$.fn.button.noConflict is not a function

Open ijackwu opened this issue 8 years ago • 11 comments
trafficstars

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

image

ijackwu avatar May 08 '17 15:05 ijackwu

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.

yii-bot avatar May 08 '17 15:05 yii-bot

Dialog::begin([
    'clientOptions' => [
        'modal' => true,
    ],
]);
echo 'Dialog contents here...';
Dialog::end();

TypeError: $.fn.button.noConflict is not a function

andrtechno avatar Sep 18 '17 09:09 andrtechno

@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; }",

fmartiner avatar Feb 21 '18 09:02 fmartiner

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 ..

lubosdz avatar May 28 '18 10:05 lubosdz

After change these line, it works...! Thanks a lot

hipogea avatar Dec 01 '18 02:12 hipogea

我也是这个问题,为什么这个bug还没修复

haohetao avatar Apr 25 '19 07:04 haohetao

@haohetao because you didn't provide a PR yet :)

machour avatar Apr 25 '19 09:04 machour

I had the same issue and solved it with MuvShots repository. I think yiisoft/yii2-jui should be fixed too.

lazarevicivica avatar Oct 04 '19 21:10 lazarevicivica

Issue still there. Main repo should be updated

perochak avatar Oct 07 '20 09:10 perochak

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.

lubosdz avatar Oct 08 '20 06:10 lubosdz

Yes, we should switch to GitHub actions.

samdark avatar Oct 08 '20 16:10 samdark