You are here: Foswiki>Tasks Web>Item10287 (05 Jul 2015, GeorgeClark)Edit Attach

Item10287: Meta should only store registered element names without a leading underscore (_).

pencil
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: CodeRefactoring, FoswikiMeta
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: GeorgeClark
I'm actually thinking to only serialise those things that are registered....

otherwise life gets much harder for non-stuffitintotext backends

diff --git a/core/lib/Foswiki/Meta.pm b/core/lib/Foswiki/Meta.pm
index 848868a..de6bc20 100644
--- a/core/lib/Foswiki/Meta.pm
+++ b/core/lib/Foswiki/Meta.pm
@@ -3550,7 +3550,9 @@ sub _writeTypes {
                 $text .= _writeKeyValue( 'name', $item->{name} );
                 $sep = ' ';
             }
+#TODO: one should actually expect it to only use the fields registered in %VALIDATE
             foreach my $key ( sort keys %$item ) {
+                next if ($key =~ /^_/);
                 if ( $key ne 'name' ) {
                     $text .= $sep;
                     $text .= _writeKeyValue( $key, $item->{$key} );

-- SvenDowideit - 26 Jan 2011

Agreed - I think, on the assumption nothing breaks. The leading _ was my pathetic attempt at defending internal fields from the mess that was the Meta module, and predates VALIDATE by several years. I would certainly not be sad to see it go (or at least be de-emphasised).

-- CrawfordCurrie - 29 Jan 2011

I've commited the change (only to ignore anything starting with _ ) - I'll contemplate more later.

-- SvenDowideit - 28 Jun 2011

Nothing else is going to happen on this for now, so closing.

-- CrawfordCurrie - 03 Apr 2014
 

ItemTemplate edit

Summary Meta should only store registered element names without a leading underscore (_).
ReportedBy SvenDowideit
Codebase trunk
SVN Range
AppliesTo Engine
Component CodeRefactoring, FoswikiMeta
Priority Normal
CurrentState Closed
WaitingFor
Checkins distro:669e67c8da8a
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r10 - 05 Jul 2015, GeorgeClark
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