0
votes

I'm trying to override the trash button in the administrator back end in Joomla

I'm putting into the controller:

    public function trash( $task = 'trash', $alt = 'trash', $check = true ){
      echo "here";
       exit();
     }

(I've also tried it with task = remove)

But I can't get it to work. Joomla ignores this and simply deletes the field.

I've already put in a save override and save2copy but I can't figure out why this won't work. Can someone help?

thanks

1
It would be good if you would give a little more context. Are you overriding a core component? Or are you overriding trash in your own component? - Elin
sorry should have said it's my own component. - user1616338

1 Answers

0
votes

I found the problem - thanks to those who've thought about it.

I'd used an auto component generator and when they had created the class they hadn't included a constructor function. So I added one and it now works fine.