bmacnaughton

Pages::saved hook called even when failure

1 post in this topic

I have a hook that creates a page for a subset of the pages on our site. It uses the saved page's name as part of the created page's name.

The problem I am having is that my hook, attached to Pages::saved(), is being called even when the page save failed because of missing fields. Is there a way I can tell that the page save failed due to missing fields?

 

Never mind - it does succeed; it just issues warnings about required fields.

 

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Mirza
      Hi All,
      I have a processwire setup for multi language which is english and arabic.
      I have a template called hotel which has title field act as hotel name for both EN & AR language.
      Since a week ago I was getting the error in 
       
      Since we have key  in pages table which states as below
      So the field name1056 should store the Arabic value of the title field.
      But its not storing the arabic value, since we have CHARACTER SET ascii for the field `name1056` as below
      Can anyone explain me 
      * On what basis character set is defined?
      * Is there any specific reason for setting the ASCII character set?
       
      Thanks in advance for the help.
    • By benbyf
      Hello,
      Does anyone know whether the is a place detailing the structure your admin theme should take when creating one? e.g. I see UiKit, Reno and Default admin themes all have default.php, init.php, controller.php files, is this a stylisitic choice or a prerequisite for any admin theme module?
      Thanks!
    • By bmacnaughton
      I am using the translation function (either $this->_() or __()) within a module that responds to AJAX API calls - there isn't really a page that is being served.
      When I supply a string with an apostrophe, e.g.,
      __('Book \'em danno') It is formatted as
      Book 'em danno  
      Is there some way to prevent output formatting when retrieving strings using the translation functions?
    • By dweeda
      At the top of each of my main pages, I want to redirect to my login page if the session is timed out.  How can I use the PW API to test for this?
      $user->isLoggedin() doesn't seem to do it, like I expected.
      THX
    • By Sipho
      I wish to access a template's allowed templates for it's children from the API. This one:

      I am pretty sure this is possible, but I can't seem to find it anywhere in the documentation. If this is not possible, is there some way of assigning properties to templates? So like fields that already have a value on all pages using that template.