NOTICE: Undefined index: last_edit

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

NOTICE: Undefined index: last_edit

Post by cmb » Mon Oct 27, 2014 3:32 pm

Hello Community,

Hartmut noted an issue wrt. the page data field last_edit: this is not necessarily defined, and will throw a respective PHP notice.

This happens typically when a new page is created with Pagemanager_XH. Unless the page is saved from the editor, last_edit is undefined. In versions before XH 1.6 the field was simply set to an empty string by the core/pluginloader. Besides the PHP notice, both variants behave the same: the timestamp of the last edit is effectively zero, so it's interpreted as being the start of the UNIX epoch. One may argue that this is somewhat correct, as the page has not really been modified, but it is probably more common have the date of the last modification to be always as least as new as the creation date.

I'm not sure how to handle this best. Another thing I'm not sure, is where to fix the issue. Either directly in Pagemanager, or generally in the PageDataModel?

Thoughts?

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: NOTICE: Undefined index: last_edit

Post by cmb » Sat Jan 10, 2015 5:34 pm

JFTR: I have fixed that in Pagemanager 2.0.5.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply