Fixed Travis errors.

This commit is contained in:
Jan Böhmer 2020-03-07 21:36:33 +01:00
parent 55b00c7f22
commit 84d268aba3
8 changed files with 13 additions and 12 deletions

View file

@ -120,7 +120,7 @@ abstract class BaseAdminController extends AbstractController
$timeTravel_timestamp = null;
if ($timestamp !== null) {
$this->denyAccessUnlessGranted('@tools.timeTravel');
$this->denyAccessUnlessGranted('show_history', $part);
$this->denyAccessUnlessGranted('show_history', $entity);
//If the timestamp only contains numbers interpret it as unix timestamp
if (ctype_digit($timestamp)) {
$timeTravel_timestamp = new \DateTime();

View file

@ -202,7 +202,8 @@ class EventLoggerSubscriber implements EventSubscriber
$this->saveChangeSet($entity, $log, $em);
} elseif ($this->save_changed_fields) {
$changed_fields = array_keys($uow->getEntityChangeSet($entity));
unset($changed_fields['lastModified']);
//Remove lastModified field, as this is always changed (gives us no additional info)
$changed_fields = array_diff($changed_fields, ['lastModified']);
$log->setChangedFields($changed_fields);
}
//Add user comment to log entry

View file

@ -66,6 +66,8 @@ class LogEntryVoter extends ExtendedVoter
return $this->resolver->inherit($user, 'system', 'show_logs') ?? false;
}
return false;
}
protected function supports($attribute, $subject)

View file

@ -53,5 +53,7 @@ class OrderdetailVoter extends ExtendedVoter
$this->resolver->listOperationsForPermission('parts_orderdetails')
), true);
}
return false;
}
}

View file

@ -52,5 +52,7 @@ class PartLotVoter extends ExtendedVoter
$this->resolver->listOperationsForPermission('parts_lots')
), true);
}
return false;
}
}

View file

@ -53,5 +53,7 @@ class PricedetailVoter extends ExtendedVoter
$this->resolver->listOperationsForPermission('parts_prices')
), true);
}
return false;
}
}

View file

@ -55,7 +55,7 @@ class EventUndoHelper
/**
* Set which event log is currently undone.
* After the flush this message is cleared.
* @param AbstractLogEntry|null $message
* @param AbstractLogEntry|null $undone_event
*/
public function setUndoneEvent(?AbstractLogEntry $undone_event): void
{
@ -64,7 +64,7 @@ class EventUndoHelper
/**
* Returns event that is currently undone.
* @return string|null
* @return AbstractLogEntry|null
*/
public function getUndoneEvent(): ?AbstractLogEntry
{

View file

@ -137,14 +137,6 @@ class PermissionsEmbedTest extends TestCase
$embed->getPermissionValue('parts', 1);
}
public function testInvalidBit3(): void
{
$embed = new PermissionsEmbed();
//When encoutering an too high bit number it must throw an error.
$this->expectException(InvalidArgumentException::class);
$embed->getPermissionValue('parts', 32);
}
public function getStatesBINARY()
{
return [