is not used any more and exists only for history. Post new tickets on the Github account. n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 13 years ago

Closed 13 years ago

#835 closed bug (fixed)

Can't set the "id" we want in the redirect response in _afterCreate() and _afterUpdate() methods

Reported by: mike Owned by: mike
Priority: normal Milestone: Jelix 1.1.2
Component: jelix:controllers Version: trunk
Severity: minor Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:


Since #330 we can modify the response in the _afterCreate() and _afterUpdate() methods. But we can't redefine the id parameter since saveupdate() and savecreate() override this param right after the call of the hooks methods... I don't think it's a security measure so I will provide a patch right now to correct this bug.

Attachments (1)

patch_835.diff (1.7 KB) - added by mike 13 years ago.
The correcting patch

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by mike

The correcting patch

comment:1 Changed 13 years ago by laurentj

  • Component changed from jelix to jelix:controllers
  • Severity changed from major to minor

why not, but I don't see why you would like to redefine this id parameter. could you explain ?

comment:2 Changed 13 years ago by mike

In my case, In my backoffice I would manage many addresses for one customer and when we add an address (_afterCreate) I would redirect to the customer list, and at first I didn't understand why it wasn't work... So I think it could happen to someone else!

Also if we allow response changes on _afterCreate (since the response object is in parameter), we have to allow to put any parameters we want ! Don't you think ?!

comment:3 Changed 13 years ago by bastnic

mike +1

comment:4 Changed 13 years ago by bballizlife

The patch does not change any behaviour to the existings crud. It also does not add complixity as this is just a move of few lines. At end, it allows developers to have a better handling on the responses. So I don't see any drawbacks and I "+1" this patch.

comment:5 Changed 13 years ago by laurentj

  • review set to review+


comment:6 Changed 13 years ago by laurentj

  • Resolution set to fixed
  • Status changed from new to closed

landed. r1353. thanks for the patch.

Note: See TracTickets for help on using tickets.