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.
The documentation comment for LogMessageParserInterface::parseMessagePlaceholders() is the following one.
/**
* Parses and transforms message and its placeholders to a common format.
*
* For a value to be considered as a placeholder should be in the following
* formats:
* - PSR3 format:
* @see https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md#12-message
* - Drupal specific string placeholder format:
* @see \Drupal\Component\Render\FormattableMarkup
*
* Values in PSR3 format will be transformed to
* \Drupal\Component\Render\FormattableMarkup format.
*
* @param string $message
* The message that contains the placeholders.
* If the message is in PSR3 style, it will be transformed to
* \Drupal\Component\Render\FormattableMarkup style.
* @param array $context
* An array that may or may not contain placeholder variables.
*
* @return array
* An array of the extracted message placeholders.
*/
The list about the placeholder formats is rendered as follows.
For a value to be considered as a placeholder should be in the following
formats:
- PSR3 format:
- Drupal specific string placeholder format:
The list items are shown indented, when they should not, and there isn't any link.
I am linking the Drupal 8.6 documentation because there isn't a link to the Drupal 8.7 documentation, so far, but the bug exists also for Drupal 8.7.
Comments
Comment #2
apadernoI would also not use the colons after each format description. The descriptions should be rendered by the following markup.
What the browsers would render is the following.
Comment #3
apadernoGiven that fully qualified class names are automatically linked, the documentation comment should be the following one.
There is a line that is longer than 80 characters, but it's not possible to split it over more lines.
Comment #4
apadernoThis is the correct patch.
Comment #5
apadernoComment #6
tim.plunkettFixing input filter
Comment #7
quietone CreditAttribution: quietone at Acro Commerce commentedthx, kiamlaluno. this will make it easier to read.
The full stop should be at the end of the sentence. And, I think, the parentheses are not needed anyway, so they can be removed. I cant' tell from reading API documentation and comment standards but I think the 'See' should be on the previous line.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedChanging attribution
Comment #9
kkalaskar CreditAttribution: kkalaskar as a volunteer and at Asentech LLC commentedHello kiamlaluno, quietone.
I created the new patch as per the comment of quietone. Please have a look once and review.
Comment #10
kkalaskar CreditAttribution: kkalaskar as a volunteer and at Asentech LLC commentedComment #11
quietone CreditAttribution: quietone as a volunteer commentedI applied the patch and looked at the code and it is an improvement, fixing the problem found in the IS, so I think this is good to go. I'm uploading the patch again because of the errors reported in the many tests in #9 are unrelated. Just want to get a clean start.
RTBC+1, I'll just wait for the tests to pass.
Comment #12
quietone CreditAttribution: quietone as a volunteer commentedTests are passing, not surprised by that. I've still got a lot to learn about documentation but this does fix the issue.
Comment #13
apadernoThe reported issue is probably caused from the
@see
directive that should not be there. The patch is not removing it.Comment #14
quietone CreditAttribution: quietone as a volunteer commentedAh, silly me. How about this?
Comment #16
apadernoComment #17
quietone CreditAttribution: quietone as a volunteer commentedThanks, kiamlaluno. I agree with that. Now, even though I made a patch here (one was a resubmission and the other was wrong) I'm going to RTBC. Improving documentation is just so helpful to so many it is worth trying the RTBC.
Comment #18
alexpottCommitted and pushed 6d98f6bf36 to 8.7.x and 8a96202f35 to 8.6.x. Thanks!
Let's put the
@see \Drupal\Component\Render\FormattableMarkup
in a good place so there is a helpful link.Fixed on commit.
Comment #21
quietone CreditAttribution: quietone as a volunteer commented@alexpott, thanks, thank makes sense.