Changeset 13781 for trunk/core/lib/Foswiki/Meta.pm
- Timestamp:
- 01/22/12 19:31:26 (4 months ago)
- File:
-
- 1 edited
-
trunk/core/lib/Foswiki/Meta.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/lib/Foswiki/Meta.pm
r13771 r13781 1877 1877 my $pretext = $text; # text before the handler modifies it 1878 1878 my $premeta = $this->stringify(); # just the meta, no text 1879 # The meta obj may not have a loaded rev yet. If anything in the 1880 # beforeSaveHandlers tries to do an access check with an unloadedRev, 1881 # it will attempt to load the latest which we really don't want it to do. 1882 # So we mark it as NEW. 1883 $this->{_loadedRev} = 'NEW' unless defined $this->{_loadedRev}; 1879 unless ( $this->{_loadedRev} ) { 1880 # The meta obj doesn't have a loaded rev yet, and we have to block the 1881 # beforeSaveHandlers from loading the topic from store. We are saving, 1882 # and anything we have in $this is going to get written anyway, so we 1883 # can simply mark it as "the latest". 1884 # SMELL: this may not work if the beforeSaveHandler tries to use the 1885 # meta obj for access control checks, so that is not recommended. 1886 $this->{_loadedRev} = $this->getLatestRev(); 1887 } 1888 1884 1889 $plugins->dispatch( 'beforeSaveHandler', $text, $this->{_topic}, 1885 1890 $this->{_web}, $this ); 1886 undef $this->{_loadedRev} if $this->{_loadedRev} eq 'NEW';1887 1891 1888 1892 # If the text has changed; it may be a text or meta change, or both … … 1912 1916 $signal = shift; 1913 1917 }; 1918 1919 ASSERT($newRev, $this->{loadedRev}) if DEBUG; 1914 1920 1915 1921 # Semantics inherited from TWiki. See
Note: See TracChangeset
for help on using the changeset viewer.
