Problem/Motivation
Site slogan is limited to 128 chars because \Drupal\Core\Render\Element\Textfield
sets this as default
The workaround is https://www.drupal.org/forum/support/theme-development/2011-01-04/increa... since Drupal6
Proposed resolution
Increase length of slogan to 255
Remaining tasks
Create patch, add tests & commit
User interface changes
Before (128 characters allowed)
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer non justo quis ligula varius cursus quis quis neque. Nunc orci."
After (255 characters allowed)
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sed orci commodo, congue ipsum eu, finibus dolor. Sed molestie leo nec luctus mattis. Nulla id ex ac nunc sollicitudin vehicula nec eget odio. Vivamus lacus neque, varius ut magna vel viverra."
API changes
no
Data model changes
no
Comment | File | Size | Author |
---|---|---|---|
#54 | Screenshot 2020-07-13 at 9.54.04 PM.png | 124.75 KB | samiullah |
#54 | Screenshot 2020-07-13 at 9.49.31 PM.png | 122.68 KB | samiullah |
#52 | 2928960-52.patch | 645 bytes | Krzysztof Domański |
#47 | 2928960-47.patch | 2.3 KB | Krzysztof Domański |
#47 | interdiff-44-47.txt | 1.45 KB | Krzysztof Domański |
Comments
Comment #2
andypostSimple patch
Comment #3
andypostComment #4
andypostHere's a test, tests still using simpletest so conversion will be done in #2862508: Convert system functional tests to phpunit
Comment #7
dawehnerWouldn't be the better test whether you can actually enter 255 characters and save it?
Comment #9
waspper CreditAttribution: waspper as a volunteer and at Skilld commentedAttached proposed patch in #4 + changes for #7.
Cheers.
Comment #11
andypostrequeued, failures in 8.6 looks unrelated
Comment #12
dawehnerThank you @waspper!
Comment #13
larowlanAre we sure we want to add this to PageTitleTest?
This test isn't about page titles. The rest of the test looks unrelated to our issue here.
Comment #14
borisson_testTitleXSS
in that same class is about the same title. I don't see a better place to do this in.We could create a followup for this issue to create a new test for that method + the new test added here.
Comment #15
dawehnerIt would be easy to create a new test class, wouldn't it?
Comment #16
andypostOn other hand title and slogan coupled in page title generation, so I see no reason to refactor tests when pate title affected of front page at least
Comment #17
borisson_I agree, that's easy, but I don't think we want to move
testTitleXSS
to that new test at the same time in this issue as well, that sounds like scope creep. I think that's better suited to a new (novice) followup.Comment #18
borisson_@larowlan: do you have an opinion about #17?
Comment #20
idebr CreditAttribution: idebr at iO commentedThe patch no longer applies since the affected test class was moved in #2862508: Convert system functional tests to phpunit
Comment #21
Neslee Canil PintoSlogan Text increased to 255 Characters
Comment #22
cilefen CreditAttribution: cilefen commentedThanks for helping out. We actually need the test changes so I’m setting this to “needs work”.
Comment #23
Neslee Canil PintoSlogan Text increased to 255 Characters and added test
Comment #24
andypostThe added test needs formatting according to coding standards, NW for that https://www.drupal.org/pift-ci-job/1200769
Comment #25
Neslee Canil PintoSlogan Text increased to 255 Characters and added test
Comment #26
Neslee Canil PintoFixed Coding Standards Issues
Comment #28
Neslee Canil PintoFixed Coding Standards Issues
Comment #31
Neslee Canil PintoThis patch needs a review
Comment #33
quietone CreditAttribution: quietone as a volunteer commented@Neslee Canil Pinto, thanks for the patch.
I reviewed the patch and found a few things. If you are like me the out of scope changes creep in when I accidentally reformat the code for the entire file and not the block I have changed.
I've been pinged lately on out of scope changes so since there are not related to issue let's remove them. And we get a smaller easier to read patch.
Looks like an extra space before '=>'.
And the testbot reports a coding standards error.
Comment #34
Deepak Goyal CreditAttribution: Deepak Goyal at Srijan | A Material+ Company for Drupal India Association commentedComment #35
Deepak Goyal CreditAttribution: Deepak Goyal at Srijan | A Material+ Company for Drupal India Association commentedHi @quietone
Updated patch as you suggested please review.
Comment #36
Krzysztof Domański1. I added test coverage of
\Drupal\system\Form\SiteInformationForm
.2. I added a negative test.
3. +1 for Increase length of slogan to 255. It looks enough. If someone needs more, they can still alter the form.
128 characters
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer non justo quis ligula varius cursus quis quis neque. Nunc orci.
255 characters
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sed orci commodo, congue ipsum eu, finibus dolor. Sed molestie leo nec luctus mattis. Nulla id ex ac nunc sollicitudin vehicula nec eget odio. Vivamus lacus neque, varius ut magna vel viverra.
Comment #37
longwaveWe don't need to call t() in tests, we have ongoing issues elsewhere to remove these calls.
Comment #38
Deepak Goyal CreditAttribution: Deepak Goyal at Srijan | A Material+ Company for Drupal India Association commentedComment #39
Deepak Goyal CreditAttribution: Deepak Goyal at Srijan | A Material+ Company for Drupal India Association commentedHi @longwave
Made changes as you suggested please review.
Comment #41
Krzysztof Domański@Deepak Goyal thanks for working on it!
The second output will be
Slogan cannot be longer than <em class="placeholder">255</em> characters but is currently <em class="placeholder">256</em> characters long.
We need to add html tags and we need the sprintf() function that formats the string.
Comment #42
Deepak Goyal CreditAttribution: Deepak Goyal at Srijan | A Material+ Company for Drupal India Association commentedHi @Krzysztof Domański
Made changes as you suggested please review.
Comment #43
Krzysztof DomańskiWe no longer need the following code.
Comment #44
Deepak Goyal CreditAttribution: Deepak Goyal at Srijan | A Material+ Company for Drupal India Association commentedHi @Krzysztof Domański
Removed above code please review.
Comment #45
Deepak Goyal CreditAttribution: Deepak Goyal at Srijan | A Material+ Company for Drupal India Association commentedComment #46
longwaveInstead of checking the explicit HTML output here should we use pageTextContains()?
Comment #47
Krzysztof DomańskiComment #48
andypostIt look good, not sure we need constant here
Comment #50
Krzysztof DomańskiUnrelated random test failure. Back to RTBC.
Comment #51
catchThis is a case where I don't think we should add test coverage - our configuration forms are generic and have generic test coverage.
Comment #52
Krzysztof Domański+1 for this approach. A similar situation in the past #2277281-50: Sometimes you want more than 128 chars of allowed file extensions.
Comment #53
longwaveWell, that certainly makes the patch simpler :)
Comment #54
samiullah CreditAttribution: samiullah at Salsa Digital commentedBefore Applying the patch I was able to site slogan with max length = 128 characters
After applying patch slogan max length = 255 character
This looks good
Moving to RTBC
Comment #55
catchCommitted 2115909 and pushed to 9.1.x. Thanks!
Comment #58
m4TT3rs CreditAttribution: m4TT3rs commentedSeems like the patch does not account for the translation of the slogan, when I want to translate the slogan in a different language it's still limited to 128 chars for the other language.
Comment #59
Krzysztof DomańskiAdded #3176880: Increase site slogan maxlength for translations.