Using the Timeline format, set the Initial date focus to "median' (My timeline starts in an empty state, the users add events over time).

Works fine when there are multiple or no nodes matching the criteria but "dies" when there's a single node. It's fine as soon as two nodes match the criteria.

Got the following error:

Notice: Undefined offset: 1 in Timeline->getDefinedDateField() (line 145 of  \sites\all\modules\contrib\timeline\includes\Timeline.class.inc).
Exception: DateTime::__construct() [<a href='datetime.--construct'>datetime.--construct</a>]: Failed to parse time string (@) at position 0 (@): Unexpected character in DateTime->__construct() (line 128 of \sites\all\modules\contrib\timeline\timeline.module).

I don't really need to use 'median' - I was just trying out the various options, the current date focus will be good enough for what I need to do.

Comments

hamish_s’s picture

Issue confirmed - only arises when one node is in the database. I also checked to assess if other "Initial Date" options bring the same issue, and discovered that the Custom option crashes the timeline regardless of how many nodes are called in.

It is possibly a related coding issue that if the first event date is before 1000, (that is, the ISO date format start date starts with a "0", if the option for First Event in the option Initial Date is called, the script assumes that the "0" is a "2". As a result, a date for 900, as the first event date, starts the timeline at 2900 AD, even if there is no event there.