0

I'm writing a routine to track inline image usage in panel panes every time the panels content form is submitted. The hook_panels_pane_update hook works, but only after the second time the form is saved. Is there a hook that will trigger the first time the form is saved?

1 Answer 1

1

Correct, according to the panels.api.php file, hook_panels_pane_update() is for changed panes. There's one just above it for new panes called hook_panels_pane_insert().

If you want the same function to happen every time regardless of whether the pane is new or not, combine them like this:

function mymodule_panels_pane_insert($pane){
  mymodule_act_on_panels($pane);
}

function mymodule_panels_pane_update($pane){
  mymodule_act_on_panels($pane);
}

function mymodule_act_on_panels($pane){
  //Do the things here
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.