netgen / TagsBundle

Netgen Tags Bundle is an eZ Platform bundle for taxonomy management and easier classification of content, providing more functionality for tagging content than ezkeyword field type included in eZ Platform kernel.
https://netgen.io
GNU General Public License v2.0
48 stars 43 forks source link

eZPublish SPI cache not cleared when renaming a tag #75

Closed gggeek closed 3 years ago

gggeek commented 6 years ago

Tested when editing tags via eztags extension, but it probably happens when editing tags via tagbundle as well (and even if not, the fix is probably better done in tagsbundle than elsewhere anyway):

This happens because the SPI Cache for the content is not cleared when the tag is edited, and apparently the tag name is stored in it.

Workaround found so far:

  1. convert ezpEvent events to Sf slots (those exists already in both eztags ext and eztags bundle)
  2. add a slot listener for eztag event "UpdateTagSignal"
  3. in it, clear SPi cache for the contents related to the given tag Id (currently needs subclassing eZ\Publish\Core\Persistence\Cache\ContentHandler)
emodric commented 6 years ago

@andrerom What do you think? What would be the best way to approach this? Are slots the right place to have SPI caches cleared?

andrerom commented 6 years ago

I'm not familiar with what was done in terms of caching here, or if this is v2 or v1 issue.

gggeek commented 6 years ago

v1

andrerom commented 6 years ago

Ah, but this is editing in legacy, so more of an issue with legacy bridge to handle then. But I don't think eztags emits any events for legacy bridge to listen to in order to clear the cache.

It's possible but would need some work across all repos, across misc versions.

Workaround is to downgrade to TagsBundle 3.2 or lower.

gggeek commented 6 years ago

Well, I am not sure if it is "only" legacy related.

The problem does manifest itself when editing in legacy, true. But the SPI cache is definitely in the eZ5 "layer".

Of the workaround steps described above, none is done in legacy bridge, and step 3 might need to be done independently of legacy kernel / bridge being enabled at all... (and yes, eztags does emit events ;-) )

ps: "v1" answer was imprecise. This was found out on tagsBundle 2.0.5, ezPkernel 5.4

emodric commented 3 years ago

Closing as obsolete.