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
Issue is based on refactoring SafeMarkup::set()
referenced in #2297703: [meta] Refactor and remove as many SafeMarkup::set() calls as possible.
/core/modules/node/node.install
has a call for SafeMarkup::set()
in function node_requirements
. This call can be removed.
Proposed resolution
This SafeMarkup::set()
can be removed and we can only use t()
with a !var
placeholder since the URL that is being generated is generated via system and not depending on user input.
User interface changes
N/A
API changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#6 | remove_safemarkup_node_requirements-2451607-06.patch | 1.74 KB | aneek |
#6 | interdiff-2451607-01-06.txt | 1.5 KB | aneek |
#1 | remove_safemarkup_node_requirements-2451607-01.patch | 1.73 KB | aneek |
Comments
Comment #1
aneek CreditAttribution: aneek commentedUploading a new patch, based on the proposed solution.
Comment #2
aneek CreditAttribution: aneek commentedComment #3
arpitr CreditAttribution: arpitr commentedI tested, treating hook_requirements as function and checked the output on devel/php after installing devel module. Output seems to be same after patching.
Comment #4
alexpottNormally links are not done this way in translated strings since node_help() for an example...
t('The <a href="!content">Content administration page</a>...
Comment #5
aneek CreditAttribution: aneek commented@alexpott, using
<a href=""></a>
like what you mentioned, HTML is double escaped. Generates,Code changes
Comment #6
aneek CreditAttribution: aneek commentedNever mind :-). Uploading a new patch. Please review.
Comment #7
aneek CreditAttribution: aneek commentedComment #8
star-szrYup, that looks better. Thanks @aneek!
Comment #9
star-szrMinor note, can be fixed on commit if the committer agrees :)
Do we even need this comment anymore? We're just doing a regular ol' t() here now, no concatenating, no SafeMarkup.
Comment #10
alexpottI agree with @Cottser - removed the comment on commit. This issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 9c44968 and pushed to 8.0.x. Thanks!
Comment #13
xjmComment #14
xjm