Skip to content

Commit

Permalink
Fix: creating migrations for Content creation or update with contents…
Browse files Browse the repository at this point in the history
… which have empty Image/File/Media fields would crash; proper fix for warnings introduced with 5.7
  • Loading branch information
gggeek committed Dec 15, 2018
1 parent 8d80c24 commit 47d1b81
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Core/FieldHandler/EzImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function hashToFieldValue($fieldValue, array $context = array())
*/
public function fieldValueToHash($fieldValue, array $context = array())
{
if ($fieldValue->uri == null) {
return null;
}

return array(
'path' => realpath($this->ioRootDir) . '/' . ($this->ioDecorator ? $this->ioDecorator->undecorate($fieldValue->uri) : $fieldValue->uri),
'filename'=> $fieldValue->fileName,
Expand Down
4 changes: 4 additions & 0 deletions Core/FieldHandler/EzMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ public function hashToFieldValue($fieldValue, array $context = array())
*/
public function fieldValueToHash($fieldValue, array $context = array())
{
if ($fieldValue->uri == null) {
return null;
}

return array(
'path' => realpath($this->ioRootDir) . '/' . ($this->ioDecorator ? $this->ioDecorator->undecorate($fieldValue->uri) : $fieldValue->uri),
'filename'=> $fieldValue->fileName,
Expand Down
2 changes: 1 addition & 1 deletion Core/Matcher/AbstractMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function matchAnd($conditionsArray)
return $results;
}

protected function matchOr(array $conditionsArray)
protected function matchOr($conditionsArray)
{
/// @todo introduce proper re-validation of all child conditions
if (!is_array($conditionsArray) || !count($conditionsArray)) {
Expand Down
16 changes: 15 additions & 1 deletion WHATSNEW.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
Version 5.7.2
Version 5.7.3
=============

* Fix: warnings due to ContentVersionMatcher methods signatures

* Fix: creating migrations for Content creation or update with contents which have empty Image/File/Media fields would
crash

Version 5.7.2
=============

* An attempt at fixing php warnings that turned out to be wrong


Version 5.7.1
=============

* An attempt at fixing php warnings that turned out to be wrong


Version 5.7.0
=============
Expand Down

0 comments on commit 47d1b81

Please sign in to comment.