SHS is not loading widget at all or elements of lower levels of hierarchical tree from taxonomy when cache is not generated.
In browser console is shown ajax error with 500 error from server when is used routing to
/shs-term-data/shs-entity_reference_field-name/vocabulary_name/[parent:tid]
But it is not happening all the time. During tests and analysis I've found that problem is connected to cache which is generated or not. Admin can see widget and it is working properly, especially when cache is rebuilded (flush). Problem is showing on lower permissions users. Weird is that when I load items for specific parent:tid as an admin this tid works fine for the editors. Looks like cache is generated then everything is ok for other users. Problem is showing if I not load earlier some parent:tid as an admin. Then editors cant choose that tid, childs are not loaded and in console you can see error 500 from the serwer.
Logs for that error:
Got error 'PHP message: Uncaught PHP Exception LogicException: "The controller result claims to be providing relevant cache met
adata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\\shs\\Cache\\ShsCacheableJsonResponse." at /home/site/public_html/core/lib/Drupal/Core/EventSubscribe
r/EarlyRenderingControllerWrapperSubscriber.php line 154It looks like SHS classes for cache and response management: ShsCacheableJsonResponse are bugged.
On Drupal instance is installed and used TAC Lite (Taxonomy Access Control Lite) but in theory it's configuration is transparent for that vocabulary. This hierarchical taxonomy is not controlled by TAC Lite. Access control depends on other vocabulary.
Comments
Comment #2
jrochate commentedI have exactly the same problem, and I also use tac_lite.
Comment #3
gbrands commentedIt appears related to this Change Record:
https://www.drupal.org/node/2513810
I'm not quite sure how/where to update the code to reflect the best practice mentioned in the Change Record.
If anyone has some pointers I'm all ears and I will take a stab at the update.
Comment #4
stborchertCould you please give some more information about your installation? I.e. what version of Drupal are you using?
I'm unsure why this error happens; there is no rendering when using ShsCacheableJsonResponse. The only place where this is used is https://git.drupalcode.org/project/shs/-/blob/2.0.x/src/Controller/ShsCo... and I don't create a renderable array there.