mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Prevented notice-level error when publishing HTMLText fiels on tables other than SiteTree. (from r89908) (from r96724)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102346 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9281b28339
commit
d89552485e
@ -1485,14 +1485,18 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
// Published site
|
||||
$published = DB::query("SELECT * FROM \"SiteTree_Live\" WHERE \"ID\" = $this->ID")->record();
|
||||
$origPublished = $published;
|
||||
$published[$fieldName] = str_replace($old, $new, $published[$fieldName], $numReplaced);
|
||||
if($numReplaced) {
|
||||
DB::query("UPDATE \"SiteTree_Live\" SET \"$fieldName\" = '"
|
||||
. Convert::raw2sql($published[$fieldName]) . "' WHERE \"ID\" = $this->ID");
|
||||
|
||||
$publishedClass = $origPublished['ClassName'];
|
||||
$origPublishedObj = new $publishedClass($origPublished);
|
||||
$this->extend('onRenameLinkedAsset', $origPublishedObj);
|
||||
// TODO: This doesn't work for HTMLText fields on other tables.
|
||||
if(isset($published[$fieldName])) {
|
||||
$published[$fieldName] = str_replace($old, $new, $published[$fieldName], $numReplaced);
|
||||
if($numReplaced) {
|
||||
DB::query("UPDATE \"SiteTree_Live\" SET \"$fieldName\" = '"
|
||||
. Convert::raw2sql($published[$fieldName]) . "' WHERE \"ID\" = $this->ID");
|
||||
|
||||
$publishedClass = $origPublished['ClassName'];
|
||||
$origPublishedObj = new $publishedClass($origPublished);
|
||||
$this->extend('onRenameLinkedAsset', $origPublishedObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user