You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I listen to the Flarum\Post\Event\Revised event, I can't get the post content as it was before editing.
I expected to have the old post content as a parameter of this event, but it wasn't there, so I used the getOriginal() method. This method returns the post content after being edited and not before.
Steps to Reproduce
Add code to listen to the event Flarum\Post\Event\Revised
Current Behavior
When I listen to the
Flarum\Post\Event\Revised
event, I can't get the post content as it was before editing.I expected to have the old post content as a parameter of this event, but it wasn't there, so I used the
getOriginal()
method. This method returns the post content after being edited and not before.Steps to Reproduce
Flarum\Post\Event\Revised
var_dump($event->post);
in the function$event->post->content
will be the same as$event->post->getOriginal('content', '')
and the old text is not present in the objectExpected Behavior
Get the old content using
$event->post->getOriginal('content', '')
or include the old post as a parameter in theRevised
event.Screenshots
No response
Environment
Output of
php flarum info
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: