This issue has novice tasks. If you are an experienced core developer and have multiple commit mentions, please review novices' work on these tasks rather than doing them yourself. Feedback from experienced contributors is valued.
Problem/Motivation
If you have a module that is incompatible with both core and your version of PHP, you get two sentences with no space after the period of the first sentence:
This version is not compatible with Drupal 8.x and should be replaced.This module requires PHP version 5.6.* and is incompatible with PHP version 5.4.26.
Proposed resolution
Be smarter about building this message. Build an array of reasons why the module is incompatible and then implode() them together with a space separator.
Remaining tasks
- Write patch (novice)
- Review patch to check it fixes the issue, the change is properly documented and for coding standards. Provide test evidence (novice)
- Keep issue summary up to date (novice)
User interface changes
n/a
API changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#19 | 2227687-d7-after.png | 29.35 KB | star-szr |
#17 | core-fix_ugly_error_messages_when_incompatible_verison_for_d7-2227687-17.patch | 2.36 KB | cs_shadow |
#15 | core-fix_ugly_error_messages_when_incompatible_verison_for_d7-2227687-15.patch | 2.32 KB | cs_shadow |
#14 | 2227687-d7-before.png | 37.47 KB | star-szr |
#9 | 2227687-after.png | 31.03 KB | star-szr |
Comments
Comment #1
star-szrTweaks to the issue summary and issue title.
Comment #2
cs_shadow CreditAttribution: cs_shadow commentedInstead of directly printing the reasons onto the screen, this patch puts each reason as an element of the 'reasons' array. If a module is found to be incompatible, then the reasons array is imploded into a string to print out each reason separated by a space.
Attaching screenshot of error messages after applying this patch as evidence.
Comment #3
Rolf van de Krol CreditAttribution: Rolf van de Krol commentedReviewed the patch. Follows coding standards and solves the issue.
Found however that when a module for some reason incompatible, the description of the module is also hidden (this was already the behavior before the patch and still is). Is this by design?
Comment #4
cs_shadow CreditAttribution: cs_shadow commentedWhile working on this patch, the same doubt came to my mind as mentioned in #3. IMO the description should still be shown to to the user, even when the module is not compatible.
Need to check if this behavior is by design.
Comment #6
star-szrThis looks good and I think #3 and #4 are a separate matter, please feel free to open another issue (after searching) to address that. The same thought crossed my mind :)
This needs some minor documentation cleanup then I think it's good to go.
This comment doesn't meet coding and documentation standards. See https://drupal.org/node/1354#drupal.
1) Missing a space after the "//".
2) Comment is over 80 characters, so please wrap.
3) "separate" is misspelled.
Comment #7
cs_shadow CreditAttribution: cs_shadow commentedFixed the documentation. Will open another issue regarding #4.
Comment #8
cs_shadow CreditAttribution: cs_shadow commented2: core-fix_ugly_error_messages_when_incompatible_verison-2227687-2.patch queued for re-testing.
Comment #9
star-szrThanks @cs_shadow! Attaching before and after screenshots to clearly show the difference.
Before:
After:
Comment #10
star-szrAnd please post back here when you create the other issue, I'd love to help with that.
Comment #11
cs_shadow CreditAttribution: cs_shadow commented@Cottser, happy to help. This is the link to the issue I opened reg #4: https://drupal.org/node/2230865. Seems we already have a patch for the same.
Comment #12
webchickLovely. Yay for spaces. :)
Committed and pushed to 8.x. Thanks!
Does this affect 7.x as well?
Comment #14
star-szrIndeed it does affect 7.x:
Comment #15
cs_shadow CreditAttribution: cs_shadow commentedAttaching the patch for 7.x
Comment #16
star-szrNice, thanks @cs_shadow!
The only thing is there are now two arrays so "an empty array" makes less sense. "two empty arrays" might work, or something that explains that there are short and long descriptions. Just mind the 80 character wrap :)
Comment #17
cs_shadow CreditAttribution: cs_shadow commentedFixed the documentation in this patch.
Comment #18
star-szrThanks, those docs look better! The early break is a bit unusual I think but can be fixed on commit IMO if someone objects :)
Comment #19
star-szrAnd here's the missing "after" screenshot:
Comment #21
star-szr17: core-fix_ugly_error_messages_when_incompatible_verison_for_d7-2227687-17.patch queued for re-testing.
Comment #22
star-szrComment #23
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks!
Comment #25
star-szr