-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlashHelper doesn't seem to fix up the error class when it's not an array #185
Comments
sorry, had to modify the code to:
|
Hi, I think, this bug is still there. At least for me. The modified code example works for me. Any chance that this will be fixed? |
What BootstrapUI version are you using, and how exactly can this be reproduced? |
BootstrapUI: 3.0.1 To reproduce this: Option1: Here' the HTML from the message: Option2: These messages are generated from the AuthComponent. Other error flashes (generated by my own code) are shown as expected (light red background, close-X at the right side...). Example: All these cases finally lead to a call of FlashComponent::set($message, $options) Option1 and 2:
Own-generated messages:
I don't know, if, how and why the different $options causes the problem. |
So it looks like the auth component sets the Your second example works fine for me, it's similar to the options that calling |
The first code example (Option 1 and 2) show the call parameters, with that the AuthComponent calls FlashComponent::set($message, $options). The second code example (Own-generated messages) shows the call parameters of FashComponent::set, when I call $this->Flash->error() in a controller method. If I mess around with the AuthComponent loading in AppController::initialize, I can get correct error flash messages from there too:
That's the HTML: I still have to check if this has unwanted side effects, but it looks like a workaround to me. :) If I use the following configuration (settting the class option as array), I get red flash messages, but no rounded edges, no margin/padding and no Close-X:
Here's the resulting HTML: |
I see. Looking into this further, I don't think there's too much that can be done right now. Being it as an array or as a string, the Adding support for the special case of the |
This is a:
bug
BootstrapUI Version: v0.5.0
What you did
I noticed that the Flash messages with general class "error" weren't being fixed up to "alert-danger".
So I updated line 72 of src/View/Helper/FlashHelper.php, adding an else for when it's not an array:
I really hope this helps.
The text was updated successfully, but these errors were encountered: