- Issue created by @ilya.no
- First commit to issue fork.
- Assigned to markie
- Status changed to Needs review
over 1 year ago 2:22pm 25 June 2023 - πΊπΈUnited States ultimike Florida, USA
@ilya.no - thanks for reporting this and the patch.
I suggest we follow the pattern that the Pathauto module uses:
$form['pattern_container']['token_help'] = [ '#theme' => 'token_tree_link', '#token_types' => $alias_type->getTokenTypes(), ];
Removing
'#type' => 'item'
from the form in Smart Trim seems to do the trick as well.I tried writing a test for this, but it seems rather pointless, IMHO. For example, in a functional test, we'd have to do something like this:
$display_repository->getViewDisplay('node', 'article') ->setComponent('body', [ 'type' => 'smart_trim', 'settings' => [ 'trim_length' => 100, 'trim_type' => 'chars', 'summary_handler' => 'trim', 'more' => [ 'display_link' => TRUE, 'class' => 'more-link', 'link_trim_only' => FALSE, 'target_blank' => 0, 'text' => 'More', 'aria_label' => 'Read more about [node:title]', 'token_browser" => '', ], ], ]) ->save();
and then test for the existence of `token_browser` in config. Then, we'd have to remove `token_browser` from the code above and then test for its non-existence in config. Otherwise, we'd have to create a functional javascript test to simulate the process of saving Smart Trim config from the UI, then testing for `token_browser` in config. Personally, I don't think it is worth the time, as this is a pretty straight-forward fix.
I've created a MR for this fix.
-mike
- @ultimike opened merge request.
- First commit to issue fork.
-
markie β
committed 1a243dd9 on 2.1.x authored by
ultimike β
Issue #3368694 by ultimike, ilya.no: Remove token_browser from saved...
-
markie β
committed 1a243dd9 on 2.1.x authored by
ultimike β
- Status changed to Fixed
over 1 year ago 7:44pm 8 July 2023 - πΊπΈUnited States markie Albuquerque, NM
looks good.. merging in and marking as fixed/
Automatically closed - issue fixed for 2 weeks with no activity.