Ticket #2243 (new defect)

Opened 8 months ago

Last modified 5 months ago

"Odd" record detection in control breaks not working correctly

Reported by: newjamie Assigned to: sminnee
Type: defect Priority: minor
Milestone: Component: Sapphire Framework
Version: 2.2.1 Severity: medium effort / impact
Keywords: odd control children easy Cc:
Due date: Hours:

Description

In a control, the <% if Odd %> statement only returns true on the first odd row, not continually throughout the firing of the control block.

For example

<% control Children %>

<% if Odd %>

Odd row %>

<% end_if %> ...

<% end_control %>

only fires one time, despite their being 8 children and the control block iterating the correct number of times.

I don't know if this is a problem just with the built-in Children control or all controls.

A temporary fix is to use:

<% control Children %>

<% if Even %>

<!-- do nothing -->

<% else %>

Odd row

<% end_if %> ...

<% end_control %>

Attachments

ViewableData.php (30.2 kB) - added by dashiel 5 months ago.

Change History

Changed 8 months ago by newjamie

Read the mistyped line

Odd row %>

as

Odd row

in the above, for the correct syntax.

Changed 8 months ago by sminnee

  • keywords changed from odd control children to odd control children easy

Tagging as "easy". This should be a simple fix of ViewableData::Odd(). Compare it to Even().

Changed 8 months ago by sminnee

  • priority changed from critical to minor

Changed 5 months ago by dashiel

Changed 5 months ago by dashiel

Uploaded a new version of ViewableData?.php that changed line 647 from

return !$this->iteratorPos % 2;

to

return !$this->Even();

Note: See TracTickets for help on using tickets.