Closed (works as designed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
install system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Nov 2014 at 19:32 UTC
Updated:
12 Feb 2015 at 22:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lauriiiComment #2
joelpittetBecause the resulting message is escaped or marked safe but then concatenated the "safeness" is lost for the new string. The resulting messages should be passed through SafeMarkup::set().
Comment #3
lauriiiComment #4
joelpittetThanks @lauriii we need some manual testing if anybody is up for it?
Comment #5
exnihilo commentedHi, I started out testing laurriii's patch. It resolved the problem of printing only one error message. The text of the feedback did not look very well, because the error messages appeared as one block of text. In case of two failures, the HTML in the error messages was printed as plain text.
With some help of marcvangend (core sprint today, Amsterdam), I rewrote the patch. Error messages are now added to an array. The SafeMarkup::escape is removed, since the messages are already sanitized by the t()-function. SafeMarkup::set is still needed, to make sure it's not escaped twice.
Each message is now wrapped in a
-tag for readability. This causes an ugly top-margin in the first paragraph (see attached screenshot). A CSS change would be nice - if we agree this is the correct approach.
Comment #6
lauriiiIm sorry but we have to escape the output. t() function is safe only if there's only static content. In the arguments there might be anything. We are printing there the mysql error messages so I'm not sure if its possible to have anything malvarous there but anyways removing that isn't in the scope of this issue. We used to have also .error class so I added it also.
Comment #7
joelpittetNode need to concatenate here.
[] .=
Comment #8
lewisnyman@exnihilo Yeah we can add some styling to accommodate paragraphs in messages (although I noticed that most messages don't use paragraph tags at all?)
See messages.css in Seven:
Comment #9
Scionar commentedComment #10
Scionar commentedComment #11
heilop commentedI working on this as part of DrupalCon LatinoAmerica Sprint.
Comment #12
heilop commentedAfter reading this issue and testing the patch, I believe the way in which the error is shown is correct, because the validation has a certain order. First it validates that the conection exsits, if it can't connect, then it should ignore the user and password errors. If the connection is correct, then you can validate user and password. If the connection and the user is correct, then you can check if the user can access the database.
Please correct me if I'm wrong.