Hello,

Bootstrap don't use the same classes for messages. It uses class "alert" instead of messages for example.

I think you should keep the drupal core classes and add the twitter ones, because it can break the normal behaviors of others modules that deals messages. For example Commerce add to cart confirmation

To correct that, you just have to change one line in bootstrap_status_messages() function.

The original code is :

    $output .= "<div class=\"alert alert-block$class\">\n";

The new code is :

    $output .= "<div class=\"alert alert-block$class messages $type\">\n";

By doing this, you can assure the compatibility with others modules, without breaking the boostrap ones.

Regards,

Alex

Comments

simon georges’s picture

Category: Support request » Bug report
Status: Active » Needs review
StatusFileSize
new699 bytes

All credit goes to zmove if the patch is okay (I just provided the patch to move the issue faster).

Status: Needs review » Needs work

The last submitted patch, 1: bootstrap-2147703-1-status_messages_class.patch, failed testing.

simon georges’s picture

Status: Needs work » Needs review
StatusFileSize
new699 bytes

My bad, I was too fast...

yenidem’s picture

I use Commerce add to cart confirmation module too, and it conflict with bootstrap theme, I already applied the patch but the overlay does not showing up properly.
How can I completely disable Bootstrap's message function?

please advice.

yenidem’s picture

Hi Simon,
The last patch does not work because the class name have to be messages as Alex typed. The patch contain as message.

Please submit as messages.

thank you for your assist.

pomliane’s picture

markhalliwell’s picture

Status: Needs review » Fixed

Thanks @zmove!

Committed a1a2cdf to 7.x-3.x:

Issue #2147703 by zmove, Pomliane, Simon Georges: You should keep drupal core messages classes.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

  • Commit a1a2cdf on 7.x-3.x, 8.x-3.x authored by zmove, committed by Mark Carver:
    Issue #2147703 by zmove, Pomliane, Simon Georges: You should keep drupal...
ryan.armstrong’s picture

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

Moving this to the 8.x-3.x branch as it has been committed to that branch. Making sure the fix gets tested in the Drupal 8 release.

maxplus’s picture

Very Nice,

I'm using Kalatheme, based on Bootstrap and I added the "function mytheme_status_messages($variables)" to my template.php with the modifications that are posted here.
Works like a charm in combination of Commerce Add To Cart Confirmation.

Thanks!

  • Mark Carver committed a1a2cdf on 8.x-3.x.x authored by zmove
    Issue #2147703 by zmove, Pomliane, Simon Georges: You should keep drupal...
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.