Skip to content
This repository was archived by the owner on Jul 7, 2022. It is now read-only.

Commit b4fa75d

Browse files
committed
Merge pull request #34 from greew/bugfix/update-to-cakephp-3.2
Fix UnitTest to work in CakePHP 3.2.x
2 parents 9c75150 + 9b51dd0 commit b4fa75d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ php:
44
- 5.4
55
- 5.5
66
- 5.6
7+
- 7.0
78

89
sudo: false
910

@@ -19,12 +20,15 @@ matrix:
1920
fast_finish: true
2021

2122
include:
22-
- php: 5.4
23+
- php: 7.0
2324
env: PHPCS=1 DEFAULT=0
2425

25-
- php: 5.4
26+
- php: 5.6
2627
env: COVERALLS=1 DEFAULT=0 DB=mysql db_dsn='mysql://[email protected]/cakephp_test'
2728

29+
allow_failures:
30+
- env: COVERALLS=1 DEFAULT=0 DB=mysql db_dsn='mysql://[email protected]/cakephp_test'
31+
2832
before_script:
2933
- composer self-update
3034
- composer install --no-interaction --dev

src/Model/Behavior/ShadowTranslateBehavior.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $o
274274
}
275275
$values = $entity->extract($this->_translationFields(), true);
276276
$fields = array_keys($values);
277+
278+
if (empty($fields)) {
279+
return;
280+
}
277281
$primaryKey = (array)$this->_table->primaryKey();
278282
$id = $entity->get(current($primaryKey));
279283
$where = compact('id', 'locale');

0 commit comments

Comments
 (0)