Problem/Motivation

The use case I'm trying to solve is when you have a token that you need replaced, but the token entity is for a paragraph that is associated to the host entity. This is currently not possible in the current architecture. Would you be open to allowing the entity to be retrieve from a different context source?

Comments

droath created an issue. See original summary.

droath’s picture

StatusFileSize
new22.26 KB

Attaching a patch with the current solution. Also would be happy to help maintain this module, if you're looking for help!

droath’s picture

StatusFileSize
new6.97 KB
new21.68 KB
smulvih2’s picture

@droath, thanks for the patch! Can you please provide steps to test this solution, including views setup and paragraph fields, etc.. I will look this this over the next few days once you provide the steps. Thanks!

chucksimply’s picture

@droath, can you include instructions on how to leverage your new patch? Thanks!

chucksimply’s picture

chucksimply’s picture

Status: Active » Needs review
chucksimply’s picture

StatusFileSize
new20.51 KB

Updated patch for latest release 2.0.2. Haven't tested on dev.

droath’s picture

StatusFileSize
new21.06 KB
new6.74 KB

I encountered an issue where I received an error message like the following:

Warning: Undefined array key 0 in Drupal\views_argument_token\Plugin\views\argument_default\TokenArgument->processToken() (line 426 of modules/contrib/views_argument_token/src/Plugin/views/argument_default/TokenArgument.php).

It was an easy change in the patch to address to ensure we don't process any empty arrays. The updated patch has been attached.

chucksimply’s picture

Running into an issue on both #8 and #9. If the View has a Page display, token gets completely dismissed when visiting that page. Thought it was a module bug, but removing this patch fixed it. See this dedicated issue for more detail.

https://www.drupal.org/project/views_argument_token/issues/3440035

chucksimply’s picture

Status: Needs review » Needs work