Does event 'writeCreate' still work? Editor Version 1.7.3

Does event 'writeCreate' still work? Editor Version 1.7.3

rw152rw152 Posts: 56Questions: 15Answers: 1

I'm using editor version 1.7.3.

Even if I put a

                ->on('writeCreate ',function($editor,$id,$values)  {
                    die('im dead');
                })

Nothing pops up and the server spits out data as usual. Am I missing something painfully obvious? I'd like to:

  1. insert data after the row has been created
  2. retrieve that data before the results are sent to the browser (i'm working my way around an MJoin issue)

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,576Questions: 1Answers: 10,483 Site admin
    Answer ✓

    That absolutely should work. If you have a look in the Editor.php file and search for writeCreate its in the _insert function. Only if there is no id returned from the insert would it fail.

    Could you show me your whole code so I can try to reproduce it?

    Thanks,
    Allan

  • rw152rw152 Posts: 56Questions: 15Answers: 1

    Hi Allan, thanks. I verified that last night before posting and here's some confirmation:

    I don't think I can post the code here, unfortunately (sorry!), but appreciate the confirmation that it should work. I'll keep digging and see if I can find anything.

    FWIW we have a left join on "Table B" from "Table A" and also an MJOIN which links to "Table C" using "Table B" (from "Table A")

  • rw152rw152 Posts: 56Questions: 15Answers: 1

    Also
    ->on('writeEdit')
    works correctly

  • rw152rw152 Posts: 56Questions: 15Answers: 1

    Been chasing this awhile... turns out I had the event written as ->on('writeCreate ') (note the space!)

    Removed the space and voila, it worked. Sorry for the annoying post.

This discussion has been closed.