Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
includes/install.inc: 'description' => t('The following modules are required but were not found. Move them into the appropriate modules subdirectory, such as <em>/modules</em>. Missing modules: !modules', array('!modules' => implode(', ', $modules))),
modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php: $summary[] = t('Date part order: !order', array('!order' => $this->getSetting('date_order')));
modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php: $summary[] = t('Time type: !time_type', array('!time_type' => $this->getSetting('time_type')));
modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php: $summary[] = t('Time increments: !increment', array('!increment' => $this->getSetting('increment')));
modules/language/src/Plugin/Derivative/LanguageBlock.php: $this->derivatives[$type]['admin_label'] = t('Language switcher (!type)', array('!type' => $info[$type]['name']));
modules/migrate/src/MigrateExecutable.php: $this->message->display($this->t('Invalid PHP memory_limit !limit, setting to unlimited.',
Proposed resolution
Beta phase evaluation
Remaining tasks
TBD
User interface changes
Ideally, fewer completely unexpected double-escaping bugs.
API changes
None.
Comment | File | Size | Author |
---|---|---|---|
#27 | 2572599-19.patch | 4.46 KB | stefan.r |
#24 | web.png | 51.82 KB | stefan.r |
#24 | drush.png | 214.75 KB | stefan.r |
#22 | interdiff-18-20.txt | 1.82 KB | stefan.r |
#22 | 2572599-20.patch | 4.43 KB | stefan.r |
Comments
Comment #2
amateescu CreditAttribution: amateescu for Pfizer, Inc. commented:)
Comment #3
stefan.r CreditAttribution: stefan.r commentedRTBC as these should all be safe to convert:
machine name
three letters in a row only (YMD / DMY / MDY)
integers only
Always wrapped in t()
integer
Comment #4
dawehnerGiven that $modules is HTML already, that won't work. What about using an inline template?
Comment #5
stefan.r CreditAttribution: stefan.r commentedActually 1 is returns a string of markup that is not marked safe (not machine names).
So maybe we need to wait for that suffix helper that's still to do?
/edit: seems @dawehner already spotted this :)
Comment #6
dawehnerWe could just do the following bit.
Comment #7
stefan.r CreditAttribution: stefan.r commentedWe could, but we don't explicitly support render arrays in hook_requirements yet, so #2505499: Explicitly support render arrays in hook_requirements() would probably need to go in first in order to do #6? A renderPlain might also work but are we sure that will work in the installer?
Discussed this with @pwolanin and just a SafeString::create() might be the safest bet for now, as well as maybe a Xss::filterAdmin() in case $modules ever becomes unsafe when code changes.
Comment #8
dawehnerSafeString::create() though is always wrong.
Comment #9
pwolanin CreditAttribution: pwolanin at Acquia commented@dawehner - since drupal_render() it not available there, the alternative we discussed of making a render array and rendering it is not possible.
I don't think this is wrong during install/requirements.
Comment #10
pwolanin CreditAttribution: pwolanin at Acquia commentedI don't even this this needs the Xss::filter(). If we are concerned it shoudl just use Html::escape()
Comment #11
dawehnerWell, SafeString::create() for not a low level system is just wrong. It gives a bad example so that people actually start using it.
Rendering something (escpecially via renderPlain()) totally works. If you argue that the render API might call out to things which doesn't exist it, its much like
any other API call, the module developers need to think about that.
Comment #12
dawehnerThe patch I posted I uploaded on comment #6
Comment #13
pwolanin CreditAttribution: pwolanin at Acquia commentedok, let's try this?
Comment #14
stefan.r CreditAttribution: stefan.r commented@pwolanin that sure looks a bit cleaner than the SafeString::create(), assuming the renderer works during the installer. Will do manual testing and post screenshots.
Not used anymore
Comment #15
pwolanin CreditAttribution: pwolanin at Acquia commentedfixing trailing commas and use statements
Comment #16
dawehnerI can't see remotely why this should be better than using the inline template from above, but well.
Comment #17
alexpottLet's use the inline item list for this... see #2505931: Remove SafeMarkup::set in ViewListBuilder
Comment #18
dawehnerAlright.
Comment #19
pwolanin CreditAttribution: pwolanin at Acquia commentedNeeds the
if (count($missing_modules)) {
Comment #20
dawehnerSadly when you manually add non existing issues, you get
Fatal error: Call to a member function getPath() on a non-object in /Users/dawehner/www/d8/core/includes/install.inc on line 914
Comment #22
stefan.r CreditAttribution: stefan.r commented@dawehner that sounds like a bug - we saw this before when removing the file scan fallback
Comment #23
dawehner@stefan.r
Yeah but its totally out of scope of the issue, right? You also posted the same patch as #20, right?
Comment #24
stefan.r CreditAttribution: stefan.r commentedThis looks OK. Screenshots for reference:
#20 is unrelated to this patch - and for the drush output the PlainTextFormattedOutput thing might be a great use case later on as this will format the HTML nicely for CLI output as well.
Comment #25
stefan.r CreditAttribution: stefan.r commentedOops @dawehner I didn't mean to post that, we cross posted. Let me do an interdiff and see if they are the same.
Let me look at the "before" output of the Required modules error as well to see if this needs a CSS followup - I kind of like the fact they are now red and on a separate line, but would be good to at least know if this is changing the look of the output in any way.
Comment #26
dawehnerAh great, maybe just ignore me
Comment #27
stefan.r CreditAttribution: stefan.r commentedRe-uploading @dawehner's patch as that is where the screenshots come from (and #22 was escaping)
The only difference with the current behavior is that the list of items is wrapping to the next line as it's a div, but this is a general problem - we run into this elsewhere as well, so it would be good if we could fix this everywhere.
This should either be a span or be an inline div, but fixing this may not be in scope here. Leaving RTBC for a core committer to have a look at this.
Comment #30
alexpottThe new line in the comma list will be addressed by #2557367: Fix inline list CSS.
Committed fc45b90 and pushed to 8.0.x. Thanks!
I cancelled the pifr test of #27 hence the failure. I'm trusting the DrupalCI test result.