Bug #8749

SelectViewHelper throws fatal error on PHP 5.2

Added by Jochen Rau over 11 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Should have
Category:
ViewHelpers
Target version:
-
Start date:
2010-07-08
Due date:
% Done:

100%

Estimated time:
Has patch:

Description

Calling the SelectViewHelper leads to the following

Fatal Error: Objects used as arrays in post/pre increment must return value by reference in ... SelectViewHelper on Line 171.

#2

Updated by Bastian Waidelich over 11 years ago

  • Status changed from New to Accepted
  • Assignee set to Bastian Waidelich
  • Branch set to v4 + v5
#3

Updated by Bastian Waidelich over 11 years ago

  • Status changed from Accepted to Needs Feedback

Hi Jochen and sorry for the late reaction.
I just tried to reproduce this and failed..

<f:form.select options="{objects}"...

with {objects} being an ArrayObject of objects does not trigger an error on PHP 5.2.6.

Do you have an example at hand?

#4

Updated by Bastian Waidelich over 11 years ago

  • Assignee changed from Bastian Waidelich to Jochen Rau
#5

Updated by Bastian Waidelich over 11 years ago

Bastian Waidelich wrote:

I just tried to reproduce this and failed..
[...]
with {objects} being an ArrayObject of objects does not trigger an error on PHP 5.2.6.

..of course I failed - it only occurs on 5.2.0
changing

foreach ($this->arguments['options'] as $key => $value) {

to
$options = $this->arguments['options'];
foreach ($options as $key => $value) {

should fix this.

#6

Updated by Karsten Dambekalns over 11 years ago

  • Branch changed from v4 + v5 to v4

Since it's only PHP 5.2 I change the branch to v4 only.

#7

Updated by Bastian Waidelich about 11 years ago

  • Assignee changed from Jochen Rau to Bastian Waidelich

I'll take care

#8

Updated by Bastian Waidelich about 11 years ago

  • Status changed from Needs Feedback to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3362

Also available in: Atom PDF