serlo / serlo.org-legacy

Legacy implementation of https://serlo.org/
https://serlo.org/
Apache License 2.0
18 stars 3 forks source link

server: Update api cache for parent when term is created #580

Closed kulla closed 3 years ago

kulla commented 3 years ago

Closes https://github.com/serlo/serlo.org/issues/560

Entkenntnis commented 3 years ago

Isn't this the same fix as for the sorting-bug? It worked in that case as I remember. The flushing seems to help trigger cache updates. @kulla Have you tested it locally? Can you confirm that it works or not?

inyono commented 3 years ago

Maybe I'm missing something. To me it seems like this code doesn't affect the API behavior at all (and only changes the "usual" behavior of TaxonomyManager which was already correct).

kulla commented 3 years ago

Maybe I'm missing something. To me it seems like this code doesn't affect the API behavior at all (and only changes the "usual" behavior of TaxonomyManager which was already correct).

It works (I have tried it locally). The function flushUpdatesForTerm($term) flushes and triggers an update event for $term for which there is an Listener in the API module. Maybe we can rename the function into flushAndTriggerUpdate($term) or we do the update triggering and the flush command in separate steps...

inyono commented 3 years ago

Check. I'm looking forward to getting rid of the whole event stuff 😅