Invenzzia »

IMPORTANT ANNOUNCEMENT

Due to the uncertain status of the Flyspray project, lack of new releases and moving the code repository to Github, we decided to shutdown this issue tracker by the end of January 2011. From that date, the bugs should be reported directly in Github project repositories.

List of repositories:

Open Power Template 2.x family

PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!

Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
Tasklist

FS#63 - Passing empty parameters in component instruction

Attached to Project: Open Power Template
Opened by nediam (nediam) - Monday, 09 March 2009, 04:10 GMT-7
Last edited by Zyx (Zyx) - Friday, 13 March 2009, 01:29 GMT-7
Task Type Bug Report
Category Compiler
Status Closed
Assigned To Zyx (Zyx)
Operating System OS-independent
Severity Low
Priority Normal
Reported Version 2.0-beta2
Due in Version 2.0-beta3
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When parameters data are empty eg:
<opt:input template="formLayout" name="keywords" value="" />

then OPT should generate:
$_component_1->set('value', '');

but it generates:

$_component_8->set('value', );

causing php syntax error.
This task depends upon

Closed by  Zyx (Zyx)
Friday, 13 March 2009, 01:29 GMT-7
Reason for closing:  Fixed
Additional comments about closing:  Fixed in rev. 63.
Comment by Zyx (Zyx) - Monday, 09 March 2009, 13:45 GMT-7
Assigned, will be fixed in the next revision.
Comment by Zyx (Zyx) - Friday, 13 March 2009, 01:11 GMT-7
Empty value in expression attributes will cause Opt_AttributeEmpty_Exception. I noticed that in fact all the instructions rely on the fact that they don't receive an empty expression. It's something like writing `foreach( as $foo)` - this code also could treat the missing expression as a string, but it generates a parse error. Returning, for example a string would be much more confusing for the end-user, especially if it happens for example with the loop instructions. Instead, OPT requires an explicite declaration if we really need an empty value and what do we mean by "empty":

~~~~
<opt:input template="formLayout" name="keywords" value="null" />
~~~~

However, please notice that `str:value=""` works and gives an empty string.

Loading...