Forum

Thread tagged as: Suggestions, Api

Generic 'update' event for PerchBase class?

We want to extend Runway to allow us to automatically generate redirects if something is changed, eg:

  • The title (which we use for a slug) of a piece of content is edited.
  • A page is moved: "about" to "about_us".
  • Name of a category is changed

As much as we try and lock down content models and site structure before launch, inevitably errors slip in, especially with ongoing publishing. We want to try and make our Runway deployments as defensive as possible for our clients and their customers.

It would be great if there was a generic 'update' event on the PerchBase class that let us know that something had been updated, and if it passed $this then we could work out what has changed.

Garrett Coakley

Garrett Coakley 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I'd be a bit worried about the performance implications of that, and the risk of initiating an infinite loop.

Are those cases no handled by

  • region.index
  • page.publish
  • category.update

?

Are region.index and page.publish both emitted when things are updated then? In which case we can use those.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Should be - let me know if not and we can fix it.

Excellent. We'll start building our proof-of-concept and let you know how we get on.