better handling of : in array keys.
#1
Posted 21 May 2012 - 11:15 AM
IPB freaks out, by any array key with : in it.
Now how common is that? depends on whether you work heavily with xml files.
As it is, im having to strip the array keys to be able to loop properly, and retreiving an array of attributes from a source tag( think itunes:creator) makes the xml kernel explode.
need better handling of this in this library quite specifically when somebodies got some free time to re-arrange a kernel with.
#2
Posted 21 May 2012 - 12:11 PM
<media:thumbnail url='someurl' type='somemimetype' />The xml library chokes on this, throws errors up trying to read the attributes.
#3
Posted 21 May 2012 - 12:22 PM
Contact Me: Email · Facebook · Twitter · Google+
Follow Invision Focus: On Facebook · On Twitter
#4
Posted 21 May 2012 - 01:06 PM
Maybe? it goes further than XML's TBH... or the specific item i am messing with.As long as the XML validates, then wouldn't this be a bug?
example.
$array = array();
$array['my:key'] = array('A', 'B', 'C');
ipsRegistry->getClass('output')->getTemplate('somegroup')->someTemplate($array);
try to loop through that array with my:key.
#5
Posted 21 May 2012 - 01:09 PM
[media:thumbnail] => Array
(
[0] => Array
(
[@attributes] => Array
(
[width] => 66
[height] => 49
[url] => http://news.bbcimg.co.uk/media/images/60363000/jpg/_60363401_fernando_torres_getty.jpg
)
)
[1] => Array
(
[@attributes] => Array
(
[width] => 144
[height] => 81
[url] => http://news.bbcimg.co.uk/media/images/60367000/jpg/_60367619_fernando_torres_getty.jpg
)
) )
this is within the "record" level.... seeing nothing that will iterate through that in the xml kernel.
#6
Posted 21 May 2012 - 01:26 PM
Contact Me: Email · Facebook · Twitter · Google+
Follow Invision Focus: On Facebook · On Twitter
#7
Posted 21 May 2012 - 01:32 PM
umm, sure, but I'm not certain it was ever designed to read that far into the xml like that in the first place? the more legitimate bug would be the array keys itself in the templates in post 4... but sure, I'll report what may be a feature request.You didn't answer my question above, if this is valid XML then why start a feedback topic about it instead of reporting it as a bug? If it's valid XML, and the XML class in IP.Board can't handle it, that's a bug.
#8
Posted 21 May 2012 - 01:50 PM
Or are you not finding a way to read nested into the arrays the XML library creates? If that's the case, you have to pass parent element name to the fetchElements() method to drill down properly.
Developer / Senior Support
If it sounds like fun, it's not allowed on the bus!

Invision Power Services, Inc.
#9
Posted 21 May 2012 - 01:56 PM
reading the xml ill likely sort, I'm already drilling down into channels and item here frankly... the feedback topic was made as a result of specifically the : in templates... stripping them creates a difference between the raw xml they would get if is not ATOM or RSS, and the data being handed when it is, leaving them causes issues when looping using those keys.Is the issue reading the XML, or handling it in the template.
Or are you not finding a way to read nested into the arrays the XML library creates? If that's the case, you have to pass parent element name to the fetchElements() method to drill down properly.
#10
Posted 21 May 2012 - 02:19 PM
apparently fetchElements IS an issue.. try to fetchElements on a tag with a : ... it fails, fetchElementsFromRecord, fetchItem, or fetchAttributesAsArray return no results, it *silently* fails.... NOW I'll report a bug on it... cause that is one.Is the issue reading the XML, or handling it in the template.
Or are you not finding a way to read nested into the arrays the XML library creates? If that's the case, you have to pass parent element name to the fetchElements() method to drill down properly.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












