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
On the REST resources page of the module the path is shown in code Tags - due to double escaping of markup in the table these tags are printed out.
Proposed resolution
Use inline_template to print out text with markup in the table row.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2015-01-18 18-12-01.jpg | 45.26 KB | SteffenR |
#4 | escape_html_in_table-2372367-4.patch | 689 bytes | SteffenR |
#1 | escape_html_in_table-2372367-1.patch | 663 bytes | SteffenR |
2014-11-10 10-14-49.jpg | 36.71 KB | SteffenR |
Comments
Comment #1
SteffenRI attached a patch solving this issue.
Comment #2
SteffenRComment #3
clemens.tolboomWhite space problems (tabs?)
I'm not sure the #type / #template is the correct way. I do understand the way but expected either 'html' for #type or another key for $uri_paths.
What do you think? Do you have link to this templating to learn from?
Comment #4
SteffenRI fixed the patch and solved the whitespace issues (was caused by misconfigured tab settings in textmate).
Regarding the templating via #type - just have a look in the BlockController.php (line 80) of core - that's the same "usecase", cause $uri_parts also contains HTML.
SteffenR
Comment #5
SteffenRComment #6
clemens.tolboom@SteffenR thanks but I get
which was obviously overlooked. Can you have a look why some path get double // ? Is this only for content entities?
Comment #7
SteffenR@clemens.tolboom: oh this "bug" is new to me - i just checked out the latest d8 release to reproduce it.
The bug comes from ResourcePluginManager - it returns the canonical url in the getDefinitions method with double slashes.
Attached a screenshot showing the issue:
I also created a new bug ticket for this issue https://www.drupal.org/node/2409789
SteffenR
Comment #8
clemens.tolboomThanks for the debugging and conclude into #2409789: Double slashes in canonicals while calling resourcePluginManager->getDefinitions()
I myself did some debugging failed to the why. The $definition key == 'entity:node === id which is in code split into /entity/entity_type so should lead to /entity/node ... somehow I guess a listener mingles the canonical path.
I guess your patch has nothing to do with this bug. Hope to process it shortly.
Comment #9
clemens.tolboomThanks @SteffenR