Changeset 13782 for branches/Release01x01/core/lib/Foswiki/Meta.pm
- Timestamp:
- 01/22/12 19:36:26 (4 months ago)
- File:
-
- 1 edited
-
branches/Release01x01/core/lib/Foswiki/Meta.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/Release01x01/core/lib/Foswiki/Meta.pm
r13773 r13782 1898 1898 my $pretext = $text; # text before the handler modifies it 1899 1899 my $premeta = $this->stringify(); # just the meta, no text 1900 1901 # The meta obj may not have a loaded rev yet. If anything in the 1902 # beforeSaveHandlers tries to do an access check with an unloadedRev, 1903 # it will attempt to load the latest which we really don't want it to do. 1904 # So we mark it as NEW. 1905 $this->{_loadedRev} = 'NEW' unless defined $this->{_loadedRev}; 1900 unless ( $this->{_loadedRev} ) { 1901 # The meta obj doesn't have a loaded rev yet, and we have to block the 1902 # beforeSaveHandlers from loading the topic from store. We are saving, 1903 # and anything we have in $this is going to get written anyway, so we 1904 # can simply mark it as "the latest". 1905 # SMELL: this may not work if the beforeSaveHandler tries to use the 1906 # meta obj for access control checks, so that is not recommended. 1907 $this->{_loadedRev} = $this->getLatestRev(); 1908 } 1909 1906 1910 $plugins->dispatch( 'beforeSaveHandler', $text, $this->{_topic}, 1907 1911 $this->{_web}, $this ); 1908 undef $this->{_loadedRev} if $this->{_loadedRev} eq 'NEW';1909 1912 1910 1913 # If the text has changed; it may be a text or meta change, or both
Note: See TracChangeset
for help on using the changeset viewer.
