Skip to content

Commit

Permalink
Replace deprecated method fetch() by select()
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra Nantel committed Jun 19, 2018
1 parent eba40c2 commit e57ca57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions extension.meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<release version="3.0.0" date="TBA" min="4.0.0" max="4.x.x" php-min="5.6.x" php-max="7.x.x">
- Update for Symphony 4.x
- Code refactoring for Database and EQFA
- Replace deprecated method fetch() by select()
</release>
<release version="2.3.3" date="2017-03-22" min="2.3" max="2.x.x">
- Supported on PHP 7
Expand Down
9 changes: 7 additions & 2 deletions fields/field.image_preview_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,13 @@ private function convertHandlesIntoIds($handles)
$parent_section = $this->get('parent_section');

foreach ($aHandles as $handle) {
$where = "AND t1.`element_name` = '$handle'";
$field = FieldManager::fetch(null, $parent_section, 'ASC', 'sortorder', null, null, $where);
$field = (new FieldManager)
->select()
->sort('sortorder', 'asc')
->section($parent_section)
->where(['t1.element_name' => $handle])
->execute()
->next();
$fieldId = array_keys($field);
$fieldId = $fieldId[0];

Expand Down

0 comments on commit e57ca57

Please sign in to comment.