History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-3164
Type: Bug Bug
Status: Postponed Postponed
Priority: Major Major
Assignee: Thomas Weidner
Reporter: Chris Abernethy
Votes: 2
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_Validate messageTemplate keys are not all unique.

Created: 22/Apr/08 07:52 PM   Updated: 27/May/09 06:30 AM
Component/s: Zend_Validate
Affects Version/s: 1.5.1
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Dependency
 
Duplicate
 
Related
 

Tags:
Participants: Chris Abernethy, Leandro Rodrigues Chaves, Thomas Weidner and Wil Sinclair


 Description  « Hide
Several Zend_Validate sub-classes use non-unique messageTemplate keys, making it impossible to provide translations.

'invalid'
Zend_Validate_Barcode_UpcA
Zend_Validate_Barcode_Ean13

'invalidLength'
Zend_Validate_Barcode_UpcA
Zend_Validate_Barcode_Ean13

'stringEmpty'
Zend_Validate_Alpha
Zend_Validate_Alnum
Zend_Validate_Digits

Since the messageTemplate keys are what is used to look up translation strings, these cannot all be translated properly. Implementing standard practice of prefixing these keys with a class name would help resolve the issue, but could break existing setups, ie:

barcodeUpcAInvalid
barcodeEan13Invalid
barcodeUpcAInvalidLength
barcodeEan13InvalidLength
alphaStringEmpty
alnumStringEmpty
digitsStringEmpty

etc.

Many others are not currently prefixed in this way, but are still unique and so do not trigger this issue at present.



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Wil Sinclair - 09/Jun/08 01:53 PM
If we'd like to address this, maybe we can coordinate with Thomas on it?

Thomas Weidner - 08/Nov/08 06:43 AM
I assigned it to me due to Wil's last comment.

Has to be discussed with the dev-team as it would be a BC break.


Thomas Weidner - 15/Dec/08 12:18 PM
I propose to make a sort of standard for keys.
A working solution would be to name the keys like:
  • classError

For example:
barcodeUpcInvalid
barCodeEanInvalid
stringLengthInvalid

and so on. I think you get an idea.


Thomas Weidner - 15/Dec/08 12:19 PM
Assigned to Matthew after a discussion in #zftalk

Thomas Weidner - 11/Mar/09 01:43 PM
Issue has been postponed until 2.0 after a discussion with the dev-team.
Reason is that the fix for this issue would be a BC break.

Leandro Rodrigues Chaves - 03/May/09 04:29 PM
Yeah, but i think dev-team could solve this right now, solving the BC issue just by keeping both old and new message keys and discouraging using of old message keys, and then removing them in 2.0.

Thomas Weidner - 03/May/09 10:56 PM
This has already been discussed in past.
Adding old and new messages raises unsolvable problems because it's not possible to have two messages available for the same error.
  • Which one of the messages should be thrown ? The new ones, or the old ones ?
  • Adding translation, as mentioned in ZF-3920, does not work, as both messages contain the same content/messageId.