Jump to content

One line fix for 5.10beta1 Webhooks failing when using cache


Recommended Posts

Posted

With Blesta 5.10beta1, an incoming Webhook fails if the cache is used.

The cache is incorrectly constructed.

Following is a one line fix. Edit line in plugin file webhooks/models/webhook_events.php
FROM
'file' => $file->getRealPath(),
TO
'file' => (new ReflectionClass($class))->getFileName(),

This inserts the correct file name for later use within the cache. The reason the workaround, which is to delete the cache, works is that when the cache is constructed the correct required file getsĀ  included in order to construct the cache, along with many others, from usingĀ  @include_once $file->getRealPath(); earlier. The $file variable is stale when used as above. Using reflection avoids having to construct an earlier mapping of each found Observer class to the file name it came from.

Posted

This fix, however, does not fix the issue of file present but uninstalled plugins having their events read and newly instralled plugins having to wait for the cache to be renewed for their events to be rrecognised. Cache renewal is forced with cache deleion.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...