The module removes all kinds of 'links' sections

Created on 17 April 2024, over 1 year ago

I just noted, that the consumer_image_styles modules image_styles, which it adds to the jsonapi output do not show up, because of the use of the keyword "links".

They use the syntax: "imageDerivativs": { "links": { "imageStyle1": { ... }, "imageStyle2": { ... } } }. No idea, why that "links" is needed, but it's there and the jsonapi_links module will kill the content. Maybe we can use the jsonapi_extra fields processing to define which "links" shall removed and which can stay.

Not sure. It would be a huge pain to define it, but it would be done only once.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany ro-no-lo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ro-no-lo
  • 🇩🇪Germany ro-no-lo

    I'll provide a fix for the 1.x branch, which will introduce a ignore list. I just have to figure out the git stuff, as always.

  • 🇧🇪Belgium vodde83

    It is somewhat unclear to me, how the ignore list actually functions.
    There is some documentation provided, but the mentioning of 'jsonapi' first got me confused as I use the JSON:API Extras module, and I changed my JSON:API path prefix to 'api'. But maybe that's just me :D

    Now, I'm not sure if it actually works, as I tried a variety of combinations in the "Do not touch" section, but all my links still end up being removed. I'm basically trying to do the same thing as the reporter, make sure the image derivatives links are kept.

    I delved a bit into the code to try and figure it out, but I keep getting either an empty string or integers in $path after this code: $path = implode('.', $this->path); (the first line in isOnIgnoreList()).
    And if $path contains simply an empty string or an integer, I'm not seeing how that could ever pass the preg_match.

  • 🇯🇵Japan ptmkenny

    @vodde83 If you change the path in a module like JSON:API Extras, you have to take responsibility yourself for modifying the path; this module doesn't have a way to determine what overrides you may have made.

    Hopefully @ro-no-lo, as the author of the code, can describe how it is supposed to work.

Production build 0.71.5 2024