Problem/Motivation
Per @webchick in #2042447-175: Install a module user interface does not install modules (or themes):

- "Authorize file system changes" as a title?
Escaped HTML for links?Taken care of in #1885564: theme.maintenance.inc (authorize.php) - Convert theme_ functions to TwigLinks going to /core/authorize.php/admin/modules and the like, which is a 403? (Apache error; same as #168).
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Beta phase evaluation
| Issue category | Bug |
|---|---|
| Issue priority | Follow up to a major issue: #2526392: authorize.php redirects to authorize.php/<none> at the end of the batch run. Only changes page title |
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | installing.png | 77.61 KB | stefan.r |
| #19 | completed.png | 55.81 KB | stefan.r |
| #19 | ftp.png | 57.97 KB | stefan.r |
| #19 | updates.png | 338.27 KB | stefan.r |
| #17 | 2547667-authorize-php-page-title-17.patch | 5.15 KB | David_Rothstein |
Comments
Comment #2
stefan.r commentedOnce we figure out where the double escaping comes from and have a new title for this page, this could be a novice issue
Comment #3
stefan.r commentedComment #4
joelpittetEscaped HTML for links? will be taken care of in #1885564: theme.maintenance.inc (authorize.php) - Convert theme_ functions to Twig
Comment #5
David_Rothstein commentedNote that #3 (links going to /core/authorize.php) is also partially fixed in the latest patches at #1885564: theme.maintenance.inc (authorize.php) - Convert theme_ functions to Twig (the reason being that it touches the same code needed to fix the double escaping, #2).
If we leave it in that issue rather than this one, that leaves this:
Which I'm not so convinced is a novice issue. We'd need to figure out why the session variable isn't being used in this code, which is therefore causing it to fall back to the default title:
Comment #6
stefan.r commentedComment #7
stefan.r commentedComment #8
David_Rothstein commentedWas maybe semi-novice in the end :) Fixed by putting back some code that existed in Drupal 7 but was removed in #2192653: Remove drupal_set_title from authorize.php. Added a test also.
Comment #9
stefan.r commentedAh, was just about to post a patch :)
@david_rothstein your patch looks good in manual testing as well. Let's remove the passing along of the title in system_authorized_init() as it's now already being set in update.authorize.inc?
Comment #10
stefan.r commentedoops I meant to remove that patch before posting the comment in #9.. I like the approach in #8
Comment #11
stefan.r commentedComment #14
joelpittetThanks @stefan.r. This looks to work well, I tried install and update a module.
Comment #15
David_Rothstein commentedThat will break the FTP/SSH case, though - since in that case authorize.php displays a form before the batch ever runs, and the form needs the correct title too.
Maybe we should do the opposite instead, though (always set the title at the beginning of the batch, never at the end)?
Comment #16
David_Rothstein commentedOh actually we can't do that though (at least not easily), since system_authorized_init() is not used in those cases.
This goes back to #8, but with a code comment explaining why we can't remove the page titles from the system_authorized_init() calls. The interdiff is from #8.
Comment #17
David_Rothstein commentedMy comment in #16 is wrong - we actually can do it easily (just set the title at the beginning of the batch process rather than the end). But it turns out there's already code trying to set a different title at the beginning of the batch process to use while the batch is running. It wasn't working though. So even with the above patches applied, you still see "Authorize file system changes" on the screen while the batch is in the middle of running.
The attached should make it work as desired all around. So the pattern now is:
Note that for manually testing this, you may need to log out and log back in again each time (otherwise the title from the previous round may still be in your session and get used as a result of that, thereby making the bug look like it's fixed when it actually isn't).
Comment #18
stefan.r commentedYes, that makes sense!
Comment #19
stefan.r commentedThis seemed to work fine in manual testing, code looks OK to me as well
Comment #20
joelpittet@David_Rothstein can you elaborate on this point you made in #18?
Will that introduce bugs for people installing multiple projects sequentially?
Comment #21
David_Rothstein commentedI should have clarified - I ran into that issue when testing the current 8.0.x behavior only (without the patch). Since some testing scenarios put the title in $_SESSION and others didn't, it was possible to run one scenario and think it worked correctly, but in actuality it only worked correctly because you had the title in $_SESSION from before.
With the patch, I believe the title gets set explicitly in every case, so if there's already something in $_SESSION it will be overwritten with the correct value. So I don't think you can run into that problem anymore.
Technically there is probably a small (existing) bug here that the page title in $_SESSION never gets unset once authorize.php is done using it... But after this patch I don't think that will matter in practice.
Comment #22
joelpittetThanks for the clarification because when I attempted to reproduce that, I couldn't:)
Comment #23
andypost+1 to fix bug
it needs follow-up to bring sanity.
"installing..." is a state of results so should live in that array key
Comment #26
David_Rothstein commentedMoving back to RTBC on the assumption that failure wasn't real.
Comment #27
stefan.r commentedComment #28
webchickAwesomesauce.
Committed and pushed to 8.0.x. Thanks!