Closed (duplicate)
Project:
Drupal core
Version:
8.1.x-dev
Component:
shortcut.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Apr 2015 at 20:44 UTC
Updated:
12 Jul 2016 at 19:21 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #1
willzyx commentedComment #2
willzyx commentedComment #5
willzyx commentedsorry.. I didn't realize that to make this patch work is necessary that the changes in #2478151: Shortcuts to pages generated by views are not recognized as added to the shortcutset and are being added multiple times are committed.
Comment #6
willzyx commentedrerolled after #2478151: Shortcuts to pages generated by views are not recognized as added to the shortcutset and are being added multiple times
Comment #7
jibranWhy not just use check_plain?
Comment #8
willzyx commentedbecause check_plain doesn't remove markup inserted by the quick edit module (see IS)... but we can probably find a better solution
and also for semplicity we should create a function (::assertShortcutQuickLink()?) for test quick link
Comment #12
jibran+1 to #8 so NW
Comment #13
willzyx commentedAdded ::assertShortcutQuickLink() util method.
Looking at #5
'name' => trim(strip_tags($variables['title']))is not a clean solution. We could usetitle_resolverto retrieve the original title of the page.Comment #14
jibranOh much better now. Let's wait for the tests. Can you please upload the new after screenshot?
Comment #16
willzyx commentedThis is weird.. it seems
title_resolvernot work at all for pages generated by views.@jibran should we open another issue for this?
Comment #17
dawehnerbut don't we want to use the actual title which was part of the page? the docs doesn't make that parts clear for me, at least.
Comment #18
willzyx commentedfor now the problem related to the solution used in patch seems to be that
title_resolvernot work at all for pages generated by viewsdawehner look at the IS. If we use $variables['title'] for node view routes, the markup created by quickedit that wraps title became part of the shortcut name and this is wrong. Of course documentation can be improved, suggestions are welcome
Comment #19
willzyx commentedLooking at #2359901: Discourage $main_content['#title'] in favor of route titles and title callbacks and #2264043: Add back a simple page title getter the
title_resolverapproach is not applicable with the current API.The only alternative I see feasible is use
strip_tagsbut I do not think is the right approachAny ideas?
Comment #20
willzyx commentedEnded up with a mixed approach: Use title from
title_resolverwhen available$variables['title']otherwise.. don't think it is the optimal solutionComment #21
jibranComment #23
jibranComment #24
lokapujyaRemoved the SafeMarkup::checkPlain() because it's in a preprocess function.
Comment #26
catchI think this should probably just use strip_tags() on $variables['title']?
Comment #27
jibranMoved tests to #2672668: Page title with HTML tags shows HTML tags in shortcut label in the shortcut toolbar tray.