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.
Split from #1898466: update.module - Convert theme_ functions to Twig because it was getting too big and not getting any reviews.
This can get consolidated later.
@ Steps to Test
Visit /admin/reports/updates
Compare the updated check time with the link.
Comment | File | Size | Author |
---|---|---|---|
#24 | 2264753-24.patch | 2.83 KB | cfox612 |
#21 | 2264753-21.patch | 1.95 KB | cfox612 |
#16 | 2264753-16.patch | 2.82 KB | cfox612 |
#12 | 2264753-12.patch | 2.82 KB | cfox612 |
#10 | interdiff.txt | 1.13 KB | star-szr |
Comments
Comment #1
joelpittetComment #2
leslieg CreditAttribution: leslieg commentedComment #3
joelpittet@leslieg I'm unassingning you from this issue. You are welcome to assign it to you again if you can still help out but just setting it up for DrupalCon code sprints.
Comment #4
steinmb CreditAttribution: steinmb commentedStealing
Comment #5
t_en CreditAttribution: t_en commentedComment #6
t_en CreditAttribution: t_en commentedChecked the html markup output before and after applying the patch https://drupal.org/node/2264753#comment-8770653. There are minor differences in whitespace and in the change of some slashes "/" into "%2F" in the destination url. Works ok in Firefox.
Before:
After applying the patch:
Comment #7
markhalliwellUltimately, I would love for the following to work. Unfortunately (and because of my extensive knowledge of the extension), I do not believe that the
{% trans %}
tag would actually allow shorthand if statements inside it:That being said, I still think it should at least switch this around so that the if statement was inside the
{% trans %}
tag and you're not using both the tag and the|t
filter:Why are we adding a variable? If there is a value, it's a timestamp (> 0). Otherwise, it would be "empty" (NULL, FALSE, "", 0, etc). The following would work just fine in the Twig template. No need to create a whole new variable:
The reason (I am guessing) that the query is being encoded,
/ => %2F
is because we're also switching from usingl()
toDrupal::l
. I am tempted to say that this is scope creep. It is also a little beyond my ability to debug why it is doing that and should perhaps be opened in a separate issue for someone more capable to fix and provide tests.Comment #8
a-fro CreditAttribution: a-fro commentedI removed last_checked per @markcarver's suggestion. However, you can't put if statements within the trans function, so I simply made it more uniform with a duplicate t function. The 3rd issue was discussed between mark and @joelpittet and no changes required.
Comment #9
markhalliwellThis is good to go.
Comment #10
star-szrMinor docs updates here to keep this at RTBC from my perspective.
I think the second way of wording this is much more readable so I made the template wording consistent with the preprocess.
Removing this line because this doesn't seem to exist as a theme function or template so not sure it will help anyone.
@ingroup themeable needs to go away.
All changes rolled in here.
Comment #11
alexpottformat_interval() is deprecated. Can be replaced with
\Drupal::service('date')->formatInterval()
. As we're replacingl()
withDrupal::l()
this seems only right.Comment #12
cfox612 CreditAttribution: cfox612 commentedRerolled with updates from comment #11.
Comment #13
cfox612 CreditAttribution: cfox612 commentedUpdating status
Comment #15
cfox612 CreditAttribution: cfox612 commentedUpdating
Comment #16
cfox612 CreditAttribution: cfox612 commentedLet's try this again... :)
Comment #18
cfox612 CreditAttribution: cfox612 commentedOkay someone please tell me what I'm missing :)
Comment #19
star-szrThanks @cfox612! It looks like the patch file has been edited directly, that's why it's not applying.
The steps in https://drupal.org/node/707484 (or https://drupal.org/node/1319154) might be helpful along with the instructions at interdiff for creating an interdiff. If you get stuck you can also come to core mentoring which starts in about 40 minutes in #drupal and runs for 2 hours :) or ping me in #drupal-twig anytime.
Comment #20
cfox612 CreditAttribution: cfox612 commentedAh okay, wasn't sure if I could just make the change there (obviously not)! Thanks I'll update!
Comment #21
cfox612 CreditAttribution: cfox612 commentedOkay third time's the charm!
Comment #23
star-szrThat's looking much better! The only thing is that we are missing update-last-check.html.twig from the patch, to avoid that
git apply --index
is your friend!Fourth time's the charm? :D
Comment #24
cfox612 CreditAttribution: cfox612 commentedFingers crossed!
Comment #26
star-szr24: 2264753-24.patch queued for re-testing.
Comment #28
joelpittet24: 2264753-24.patch queued for re-testing.
Comment #30
star-szrWe had a misbehaving testbot but I think it's time to go back to RTBC-land. Thanks for your patience and persistence @cfox612 :)
Comment #31
cfox612 CreditAttribution: cfox612 commentedLet me know if I did miss something! Still learning :)
Cottser - Thanks so much for all your help!
Comment #32
alexpottCommitted 432b5a7 and pushed to 8.x. Thanks!