Skip to content

Commit

Permalink
Merge pull request #3 from fromholdio/migrate-image-fields
Browse files Browse the repository at this point in the history
add deprecated getInheritedFeatureImage() method for backwards compatibility
  • Loading branch information
dizzystuff authored Jun 7, 2023
2 parents 278810e + fe988e0 commit 496a302
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Extensions/FeatureImagePageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use SilverStripe\Assets\Image;
use SilverStripe\CMS\Model\SiteTreeExtension;
use SilverStripe\Core\ClassInfo;
use SilverStripe\Dev\Deprecation;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\HiddenField;
use SilverStripe\Forms\OptionsetField;
Expand Down Expand Up @@ -74,6 +75,15 @@ public function getFeatureImage()
return $image;
}

/**
* @deprecated 1.1.0 Use getFeatureImage() instead
*/
public function getInheritedFeatureImage()
{
Deprecation::notice('1.1.0', 'Use getFeatureImage() instead');
return $this->getOwner()->getFeatureImage();
}

public function updateCMSFields(FieldList $fields)
{
$tabPath = $this->getOwner()->config()->get('feature_image_tab_path');
Expand Down

0 comments on commit 496a302

Please sign in to comment.