Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Sep 2015 at 11:55 UTC
Updated:
4 Oct 2015 at 17:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dawehnerThere we go.
Comment #4
dawehnerFixed the failures.
Comment #6
xjmHm hard to read. Could we just kill the
SafeMarkup::format()and just assert the string?Hmm. This gets at what I was concerned about with these -- what escaping is correct for all of these messages? Are we introducing malformatted messages where some markup is escaped twice, or what did this look like in HEAD?
Comment #7
dawehnerI think we should, it makes things easier to read!
Well, IMHO those exceptions should be in english without using t() or anything escaping related in the first place, see our usage to just concat everything together for exception messages.
Good luck with figuring out how to cause those exceptions in migrate.
Comment #8
dawehnerWell, its tricky because those messages are supposed to be used both in CLI and the Drupal UI (for some potential future but IMHO not so helpful migrate UI), so we need the proper HTML escaping strategy.
Some manual testing:
Let's see whether this was enough manual testing.
Comment #9
alexpottComment #10
alexpottWe shouldn't be using t() here - also as this is never caught the correct thing to do here is to remove t completely. And join the strings together.
Let's just call Html::escape on the entire string.
Comment #11
dawehnerWell, the problem is that those messages are displayed for the user, do we want to deal with that?
Sure.
Comment #12
alexpottAh I see...
Wow there is some ugly code here...
So imho we should create a specific exception for each message and catch in the batch process and have the translations done their. This exception communication pattern is not nice.
Comment #13
dawehnerWell, I tried staring with that, but then I realized we would have not only fix the exception messages in Updater, but also FileTransfer which has file transfer specific exceptions,
like "NO FTP backend available" ... so yeah in other words these messages are currently not translatable.
Comment #14
alexpottThis is part of the critical meta.
Comment #15
lauriiiNo idea if this is gonna fly..
Comment #16
dawehnerI doubt that getting rid of the try catch will help at all. can you clarify what you had in mind with that change?
Comment #19
lauriiiSo idea I had in my mind was to get rid of multiple level of exceptions. I'll keep working on this one.
Comment #20
dawehnerI still don't get that why we need to solve that to solve the critical part of the issue. You can improve things for ages. Imho we need tests for that stuff instead to not loose safety in the first place.
Comment #21
lauriiiCreated UpdaterFileTransferFolderException for the case where folder creating fails. I also ensured that thaa Updater::update() is not being used anywhere else than in the update_authorize_batch_copy_project().
Comment #22
lauriiiComment #25
lauriiiGET http://ec2-54-191-113-78.us-west-2.compute.amazonaws.com/checkout/user/l... returned 0 (0 bytes).
Comment #26
lauriiiComment #27
dawehnerWell, the reason for the try {} catch {} in
\Drupal\Core\Updater\Updater::updateis because the transfer mechanism might throw an exception,and we simply can't and shouldn't know which one exist.
Comment #28
joelpittetLet's move the exception moving around to a follow, this is getting out of scope to help unblock the !placeholder removal.
While it is a good suggestion to deal with separating translations from exception messages, the scope of changes needed it deserves it's own issue.
Comment #29
joelpittetI've tried to boil off the conversation into the follow-up here:
#2571565: Installer and Upgrade specific Exceptions caught for translated messages.
@lauriii please post your solution over there for the try/catch and specific message catching.
This one needs to be re-posted back to #11 with any other changes needed since then.
Comment #30
alexpottI agree with #29 - and sorry it's my fault that the scope expanded, it is a shame that the fix is not simple but I definitely think it worth reducing scope here to get the
!placeholderremoval done.Comment #31
lauriiiWorking on this
Comment #32
lauriiiI'm just re-uploading the patch from #11.
Comment #33
joelpittetChecked to see if I could find any more by grepping around for
ag -C 2 getMessageComment #34
alexpottCommitted ab01a83 and pushed to 8.0.x. Thanks!