Hello!
Can I disable this module for admin theme?
Because I do not want enable bootstrap for default admin theme Seven. Without bootstrap i'm getting js errors and it's broken CKEditor and many other JS modules.

Comments

ckng’s picture

Priority: Critical » Normal
Status: Active » Closed (works as designed)

Please use jquery_update 7.x-3.x-dev as of this writing. You will be able to use default 1.4 for admin and configure separately for theme.

UksusoFF’s picture

Yes, i know. But it's not fix issue.

TypeError: $(...).on is not a function
$('.bootstrap-fieldgroup-nav-type', context).on('change', function() {
mutateForm($(this));
});

ckng’s picture

Depends on the bootstrap version, you should use jQuery >= 1.9.1 for your theme.

UksusoFF’s picture

I mean this error in Seven theme.
I do not want include bootstrap in default admin theme - Seven.

ckng’s picture

Title: Disable module for admin section » Module breaking admin theme like Seven
Status: Closed (works as designed) » Postponed (maintainer needs more info)

Could you provide more details, how to reproduce the problem, what is actually broken? Screenshot or url would be great.

UksusoFF’s picture

StatusFileSize
new57.29 KB
new96.2 KB

Seven Theme 7.36
jQuery Update 7.x-3.x-dev
Site default jQuery version 1.11
Seven (admin theme) 1.4 (Drupal core)
I've trying add node with Bootstrap fieldgroup.

cha0s’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

The way field API works is you can manage fields, and you can manage display.

Manage fields has to do with the entity (node) creation/edit form, which is using your administrative theme. Your administrative theme here is Seven, which is not a bootstrap theme. So, you don't want to use bootstrap_fieldgroup in the manage fields section.

Manage display has to do with entity (node) rendering, which uses your normal site theme. I'm assuming you're using a bootstrap theme for the site default theme. So, use bootstrap_fieldgroup in the manage display section.

UksusoFF’s picture

Yes, i can use default site theme on node edit form. By check this: "Use the administration theme when editing or creating content" in Appearance settings.

But maybe need add some check for test bootstrap is loaded in JS?
For eg: http://stackoverflow.com/questions/13933000/how-to-check-if-twitter-boot...

This error can confused some users ;)

cha0s’s picture

Status: Closed (works as designed) » Fixed

Fair enough, you convinced me. I added in a little hack to try to add a message for the user as well as disabling the JS.

  • cha0s committed 82fec98 on 7.x-1.x
    Issue #2425273 by UksusoFF, cha0s: Module breaking admin theme like...
UksusoFF’s picture

StatusFileSize
new68.82 KB
new612.3 KB

Thanks, but on bootstrap theme it's show warning too.

cha0s’s picture

Status: Fixed » Needs work

I actually went to your site, rock63.ru and ran the code: (typeof jQuery().modal == 'function'). It returned TRUE, so I'm not sure why you're seeing that error.

UksusoFF’s picture

Yes, look on message icon. Why it's green check on second screen?

UksusoFF’s picture

BTW, with this commit it's not get JS-error on Seven theme and not breaking CKEditor.

ckng’s picture

This is causing the message shown on a bootstrap subtheme.
"You are using bootstrap_fieldgroup on a non-bootstrap theme. The JavaScript has been disabled, however you should remove the bootstrap field groups appearing on this page (or change the theme)."

(typeof $().modal == 'function')

is returning true in my case.

It is not a good check as well, what if modal is disabled, it will cause this to be triggered as well.

Probably a better solution is from php side, not to load the bootstrap_fieldgroup.js based on admin theme setting?

ckng’s picture

More information:

I'm using Seven as admin theme but "Use the administration theme when editing or creating content" is unchecked.

ckng’s picture

On top of that, manipulating the error messages from js is a bad idea, IMHO. If user has customized/themed the error messages any other way then this is going to break.

milos.kroulik’s picture

The module also breaks settings dialog for field group settings, when Format is set to one of the module's values. The JS error is:

TypeError: $(...).on is not a function

It's reasonable to assume, that non-Bootstrap theme is used on Manage display page.

Please let me know, if I should create separate issue for this.