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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...