I've successfully used bootstrap as my admin theme on other sites but on my latest projet it seems to break most of the admin forms (can't enable modules, change the admin theme back to seven, etc).

Has anybody seen this behavior before ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

csakiistvan’s picture

I download the latest .dev version of bootstrap theme, but i can see the modules, and /admin pages.

Please, see the php error log, i think the answer it there are!

PascalAnimateur’s picture

I can see the pages .. only I cannot save anything (stays on the same page, no confirmation message, options are exactly the same).

markhalliwell’s picture

Status: Active » Closed (cannot reproduce)

I cannot reproduce this on http://simplytest.me/project/bootstrap http://simplytest.me/project/bootstrap/7.x-3.x (after manually setting jquery_update to 1.8). It is likely either a module or server configuration (memcache?) that might be causing this. Regardless, the theme works just fine on a vanilla core install.

jday’s picture

Steps to reproduce:
1. Install and enable bootstrap, colorizer, features, jquery_update
2. Set bootstrap as the admin theme
3. Set jquery update to 1.8
4. Create a new feature (admin/structure/features/create)
4a. You'll need to disable/adjust some of the css so that the fieldset contents are visible.
5. Select 'colorizer' or ANY module under Dependencies
6. See the carnage

Looks like field wrappers are duplicated inside each other, and other elements are respawned to a devastating degree. See attachments. We have the duplication issue on other forms but this scenario is the easiest to reproduce.

PascalAnimateur’s picture

Update:
I have the exact same site on two different servers... one is my local development environment (Ubuntu 13.10 / PHP 5.5.3) and the other is on my hosting provider (PHP 5.3.28).
While it works fine on my dev server, most forms don't work in the hosting environment :
Upon submission, I get a "HTTP/1.1 403 Forbidden" error on the POST request.
I'll investigate the issue with my provider and report back if I find a solution.
Another update:
Using the Bartik theme, it works and the submit button's markup looks like:
<input id="edit-submit" class="form-submit" type="submit" value="Enregistrer" name="op"></input>
Using Bootstrap, this markup looks like :

<button id="edit-submit" class="btn btn-success form-submit" type="submit" value="<span class="icon glyphicon glyphicon-ok" aria-hidden="true"></span> Enregistrer" name="op">
    <span class="icon glyphicon glyphicon-ok" aria-hidden="true"></span>
     Enregistrer
</button>
PascalAnimateur’s picture

Ok.. the problem lies with the added span (class="glyphicon...") markup in the value of the button. My hosting provider probably prevents such html tags in POST requests.. by removing these the form works OK!
Could we add a configuration to disable these?

markhalliwell’s picture

Title: Bootstrap as admin theme breaks forms » Button value attribute contains markup
Component: User interface » Code
Priority: Normal » Major
Status: Closed (cannot reproduce) » Active

Ah, that could very well be the case. Thank you for looking into this, it's an odd bug to say the least.

I agree, all markup should be stripped from the value attribute. Probably even trimmed and sanitized to be safe as well.

PascalAnimateur’s picture

Here's a patch that fixes the problem !

PascalAnimateur’s picture

Status: Active » Needs review
jday’s picture

Updating our site to use 7.x-3.x-dev and it looks and works fantastically, thanks for the quick fix!

yenidem’s picture

I use Hierarchical Select module with bootstrap, there is a dropbox for multiselection and the code of submit button for adding terms below;

<input class="add-to-dropbox form-submit" id="edit-field-ana-dizin-und-hierarchical-select-dropbox-add" name="op" value="Add" type="submit">

If I use bootstrap despite I use another admin/node edit theme the submit button code showing as below and it does not work like this;

<button class="add-to-dropbox btn btn-success form-submit" id="edit-field-ana-dizin-und-hierarchical-select-dropbox-add" name="op" value="Ekle" type="submit">Add</button>

I applied the patch#8 but it did not work for me,
please advice.

markhalliwell’s picture

markhalliwell’s picture

Title: Button value attribute contains markup » Add #icon and #icon_position to variables and stop altering values of elements
Priority: Major » Critical
Status: Needs review » Needs work
Related issues: +#2206005: Translation interface not working or showing any results, +#2206141: glyphicon-filter is making translation interface not to work

Bumping this to critical because a core issue was filed (when it shouldn't have been). The more I think about this, I think the approach we should take instead is adding an #icon variable that we can use (similar to how we have #context). This allows us to pass an icon to use, without altering the value. Adding related issues.

  • Commit 5ffa7f1 on 7.x-3.x by Mark Carver:
    Issue #2219965 by Mark Carver, PascalAnimateur: Add #icon and #...
markhalliwell’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Assigned: Unassigned » ryan.armstrong
Status: Needs work » Needs review
yenidem’s picture

I submitted my comment to wrong issue, my comment moved to under correct issue;
Decrease JS specificity to allow "button" elements

  • Commit 5ffa7f1 on 7.x-3.x, 8.x-3.x by Mark Carver:
    Issue #2219965 by Mark Carver, PascalAnimateur: Add #icon and #...

  • Mark Carver committed 5ffa7f1 on 8.x-3.x.x
    Issue #2219965 by Mark Carver, PascalAnimateur: Add #icon and #...
markhalliwell’s picture

Version: 8.x-3.x-dev » 7.x-3.x-dev
Assigned: ryan.armstrong » Unassigned
Status: Needs review » Closed (fixed)

I'm just moving this back to 7.x. If this needs re-evaluation in 8.x, create a new issue.