3341 Posts in 982 Topics by 703 members
|Go to End|
8 January 2011 at 6:48am Last edited: 8 January 2011 10:56am
in my code I have a subclass of Page, and I am trying to update some of its additional parameters but unlike regular updates my changes do not take effect. They are visible in the admin console as unpublished versions, how can I just simply change some parameters?
I have overridden canEdit and canPublish to allow changes from any user (as that will be my intended use) but I am trying it out with admin anyway, the code looks similar to this:
$product->QuantityInStock -= 1;
I have also tried calling following:
None of it actually publishes the page, it only produces unpublished versions which I can review in the admin console and can "roll back" to them but that is not really what I want as I would like to have a counter on the page which any user can update via special form and code.
Also, I only want to update the product object, it is not created anew.
I would really appreciate some help!
8 January 2011 at 8:23pm
I believe you would need to call write() then publish().
19 January 2011 at 12:45pm
Just to give people a reply if they find this post via google - I have tried multiple ways (staging and publishing etc.) but did not manage to make it work.
I have done alternative solution - I have created an extra object with has_one relationship on the page which is not versioned and I have created a setter and getter on the page so it behaves like internal parameter. I did not need the versioning for that param so it was viable solution for me.
|Go to Top|