Jump to content

Hook issue after upgrading to 3.0.210 from 3.0.165


PWaddict
 Share

Recommended Posts

Hello and happy new year!

Today, I decided to upgrade a site to 3.0.210 from 3.0.165 and so far I noticed one issue. The following hook doesn't work properly (worked fine on 3.0.165). It changes the text but it won't let the non-superuser to delete the page. Pressing the button redirects the page https://mysite.test/admin/page/edit/?id=11293 to https://mysite.test/admin/page/edit/?id=11293&s=1&c=1 

/**
 * Rename "Move to Trash" text on Delete tab's button
 *
 */
$wire->addHookBefore('InputfieldButton::render', function(HookEvent $event) {

  if ($event->object->id != "submit_delete") return;
  if ($this->wire('user')->isSuperuser() == false) $event->object->value = "Hello World";

});

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...