- ๐บ๐ธUnited States smustgrave
Re-reading the issue summary this seems like it probably should be handled by custom module. Mentions linkit so maybe that's where it should go?
Moving PNMI as don't know where else to put it.
- ๐บ๐ธUnited States mark_fullmer Tucson
Re-reading the issue summary this seems like it probably should be handled by custom module. Mentions linkit so maybe that's where it should go?
Some of the other comments (17, 21) mention other contexts where it would be useful to have a token that indicates the node status: Rules ("where logic based decisions are based on token input") and content moderation notifications (though โจ Add tokens for content moderation state Needs work will usually be more useful for folks than the published status). If there is more than one external context where this is relevant, it makes sense to put this in core: we wouldn't want to have to tell someone who's looking to use this in Rules that they need to install LinkIt!
An argument for not putting it in core is that folks might want to change the label of this output. For example, if they wanted "Unpublished" to render as a more comprehensible "Not published."
Implementing this in custom code, or in the LinkIt contrib module, is a facile change, but maybe there's an architectural rationale for putting it in core, too? The node entity is provided by core, node status (published/unpublished) is a paradigm originating in core, and the node module in core already has a number of similar tokens defined.
- ๐บ๐ธUnited States mark_fullmer Tucson
I've updated the issue description to better capture the community's conversation about this.
- Status changed to Needs review
almost 2 years ago 3:24pm 24 February 2023 - ๐บ๐ธUnited States smustgrave
Thanks! Unfortunately I can't review it since I worked on it some. Will have to see if someone else can.
- Status changed to Needs work
almost 2 years ago 4:10pm 24 February 2023 The Needs Review Queue Bot โ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to Needs review
over 1 year ago 4:30pm 31 March 2023 - ๐บ๐ธUnited States mark_fullmer Tucson
The attached patch:
1. Removes the integer-based token, since multiple commenters above cannot establish its value in core (catch in #22, alexpott in #39, acbramley in #40).
2. Updates the test coverage to explicitly look for 'Published' and 'Unpublished' text, and removes thet()
usage, per #40.
3. Declares usage ofFormattableMarkup
to make syntax checking happy (#47).Setting back to "Needs review"!
- ๐บ๐ธUnited States ricksta
I can confirm the patch works. Screenshots attached.
- Status changed to RTBC
over 1 year ago 8:14pm 31 March 2023 - last update
over 1 year ago 30,320 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass 55:43 54:29 Running- last update
over 1 year ago 30,322 pass 10:43 6:59 Running- last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,322 pass - last update
over 1 year ago 30,324 pass, 1 fail - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
Hm, I see not many people found the numeric token useful in comments but do we have similar tokens where we only expose a derivative textual value of the internal value in tokens and not the base value? It seems like an odd pattern to me.
- last update
over 1 year ago 30,330 pass 10:43 4:53 Running10:43 7:51 Running10:43 9:31 Running10:43 5:21 Running10:43 9:31 Running- last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass - last update
over 1 year ago 30,334 pass 25:43 23:43 Running- last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass - last update
over 1 year ago 30,335 pass 55:43 52:16 Running- last update
over 1 year ago 30,338 pass - last update
over 1 year ago 30,338 pass - last update
over 1 year ago 30,338 pass - last update
over 1 year ago 30,341 pass 40:43 39:33 Running- last update
over 1 year ago 30,341 pass - ๐บ๐ธUnited States mark_fullmer Tucson
do we have similar tokens where we only expose a derivative textual value of the internal value in tokens and not the base value. It seems like an odd pattern to me.
Yes, a number of the tokens in node.tokens.inc do this: the "author" token returns the username rather than the UID, and the "changed" and "created" tokens return formatted dates, rather than raw timestamps.
- last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass 25:43 24:34 Running40:43 39:33 Running- last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass - last update
over 1 year ago 30,341 pass -
lauriii โ
committed b23fad55 on 11.x
Issue #3073554 by mpp, ravi.shankar, smustgrave, mark_fullmer, alexpott...
-
lauriii โ
committed b23fad55 on 11.x
- Status changed to Fixed
over 1 year ago 9:01am 4 July 2023 - ๐ฆ๐บAustralia GuillaumeG
Awesome, thanks for getting that merged to 11.x !
Could we also get that change backported for 10.2 ?
- ๐ซ๐ฎFinland lauriii Finland
10.2.x will be branched from 11.x later this year and this will be in there ๐
Automatically closed - issue fixed for 2 weeks with no activity.