Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.5.0

Bug #19526 vcard build drops extension properties
Submitted: 2012-07-22 20:49 UTC
From: bkdotcom Assigned: till
Status: Closed Package: File_IMC (version 0.4.3)
PHP Version: 5.3.0 OS: Windows XP
Roadmaps: (Not assigned)    

 [2012-07-22 20:49 UTC] bkdotcom (Brad Kent)
Description: ------------ "attached" test script imports a valid 2.1 vcard then turns around and builds it. actually demonstrates 3 bugs a) exception thrown for missing FN property (which is not required for vcard 2.1 b) X-ANNIVERSARY is parsed and maintained in builder's value and param arrays, but not output by fetch() c) parser returns property groups , however builder doesn't support them. Test script: --------------- $vcf = <<<EOD BEGIN:VCARD VERSION:2.1 N:User;Test;;; X-ANNIVERSARY:2007-12-08 A.TEL;HOME:+1-213-555-1234 A.NOTE:This is my vacation home. NOTE:This is a test END:VCARD EOD; $parser = File_IMC::parse('vCard'); $vcf_data = $parser->fromText($vcf); $vcf_data = $vcf_data['VCARD'][0]; $vcf = File_IMC::build('vCard'); // new builder $vcf->setFromArray(array($vcf_data)); $vcf = $vcf->fetch(); Expected result: ---------------- example should more-or-less simply output what was input Actual result: -------------- fetch returns (minus the missing FN exception) : BEGIN:VCARD VERSION:2.1 N:User;Test;;; TEL;TYPE=HOME:+1-213-555-1234 NOTE:This is my vacation home. END:VCARD X-ANNIVERSARY was dropped and NOTE got all munged due to broken/unsupported groups


 [2012-07-22 20:54 UTC] bkdotcom (Brad Kent)
 [2012-08-02 20:42 UTC] bkdotcom (Brad Kent)
Regarding A.NOTE:This is my vacation home. NOTE:This is a test File_IMC's documentation: General note: we use the terms "set", "add", and "get" as function prefixes. "Set" means there is only one iteration of a component, and it has only one value repetition, so you set the whole thing at once. "Add" means eith multiple iterations of a component are allowed, or that there is only one iteration allowed but there can be multiple value repetitions, so you add iterations or repetitions to the current stack. ----------------- I See nothing in the 2.1 specification limiting any parameter/component to one value/repetition. Section 2.1.4 - Grouping : seems to imply that any property/component can occur more than once "A Property Grouping is the definition of a method for specifying a collection of related properties within a vCard object. There is no requirement on a vCard reader that it preserve the property group name. However, the vCard reader is required to preserve the grouping of the properties. " And the only example given: A.TEL;HOME:+1-213-555-1234 A.NOTE:This is my vacation home. They don't show that the vCard could also include B.TEL;WORK;PREF:+1-213-555-5678 B.NOTE:This is where you'll likely reach me. but it seems to be implied?
 [2012-08-05 20:21 UTC] bkdotcom (Brad Kent)
 [2012-08-05 20:23 UTC] bkdotcom (Brad Kent)
 [2012-08-05 20:30 UTC] bkdotcom (Brad Kent)
All 3 bugs patched, further enhancements added, & more with attached patches to IMC/Build.php and IMC/Build/Vcard.php learn more @
 [2012-08-10 21:43 UTC] till (Till Klampaeckel)
-Assigned To: +Assigned To: till
Thanks - as I noted on the other tickets. Mind sending me pull requests?
 [2012-08-15 16:47 UTC] till (Till Klampaeckel)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.