mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Prevented notice-level error when publishing HTMLText fiels on tables other than SiteTree. (from r89908)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96724 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ba0dd8b5eb
commit
84d819f350
@ -1443,6 +1443,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
// Published site
|
||||
$published = DB::query("SELECT * FROM \"SiteTree_Live\" WHERE \"ID\" = $this->ID")->record();
|
||||
$origPublished = $published;
|
||||
|
||||
// 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\" = '"
|
||||
@ -1454,6 +1457,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a FieldSet with which to create the CMS editing form.
|
||||
|
Loading…
x
Reference in New Issue
Block a user