You are here: Foswiki>Tasks Web>Item12100 (08 Oct 2012, JulianLevens)Edit Attach

Item12100: Returned META not clean

pencil
Priority: Normal
Current State: Being Worked On
Released In: n/a
Target Release: minor
Applies To: Engine
Component:
Branches:
Reported By: JulianLevens
Waiting For: SvenDowideit
Last Change By: JulianLevens
After

  • my ($meta, $topicText) = Foswiki::Func::readTopic( $w, $t );

Then the resulting META can have repeated elements, e.g. any META:TYPE without a name should only appear once, but if the data contains two:

META:TOPICINFO{author="FRED" date="1234"}
META:TOPICINFO(author="BILL" date="3456"}

Then the relevant array will hold two entries. Yes after careful reading of the docs/code etc you realise that array[0] is the correct one, but why pass on the broken-ness?

Are there compatibility issues that require this broken-ness? If so, then an extra function to clean up meta would be an option. Either way the clean meta should also honour Foswiki::Meta::VALIDATE

-- JulianLevens - 26 Sep 2012

META:TOPICINFO is also a more complicated case. we (by convention) only parse it if its the first line in the file - otherwise, its ignored for META and left in.

other META:TYPES can have repeated elements, and yes, I'm working on simplifying this, but compatibility first.

I was going to remove it, but I found some plugins that use the array nature, so clearly we have to use the deprecation process instead.

(so, bad example, but yup.)

-- SvenDowideit - 27 Sep 2012

When uploading data in Versatile I only take array[0] for non-named META (which includes TOPICPARENT and FORM even though they have a name).

Are you saying that I need to store array[1..n] if found or I'll lose stuff that some plugins expect to exist? Or are some plugins not calling the relevant API and referring to array[0] directly?

-- JulianLevens - 27 Sep 2012

yes, some plugins use meta->find and putAll - One published plugin that appears to use some of the API is WorkFlowPlugin, so that may be a useful test point.

As usual, I'm much more worried about inhouse non-published plugins :/

-- SvenDowideit - 28 Sep 2012

See also Item12123

-- JulianLevens - 08 Oct 2012
 

ItemTemplate edit

Summary Returned META not clean
ReportedBy JulianLevens
Codebase 1.1.5, trunk
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState Being Worked On
WaitingFor SvenDowideit
Checkins
TargetRelease minor
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r5 - 08 Oct 2012, JulianLevens
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy