mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Fixed Travis errors.
This commit is contained in:
parent
55b00c7f22
commit
84d268aba3
8 changed files with 13 additions and 12 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -66,6 +66,8 @@ class LogEntryVoter extends ExtendedVoter
|
|||
|
||||
return $this->resolver->inherit($user, 'system', 'show_logs') ?? false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
|
|
|
@ -53,5 +53,7 @@ class OrderdetailVoter extends ExtendedVoter
|
|||
$this->resolver->listOperationsForPermission('parts_orderdetails')
|
||||
), true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -52,5 +52,7 @@ class PartLotVoter extends ExtendedVoter
|
|||
$this->resolver->listOperationsForPermission('parts_lots')
|
||||
), true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -53,5 +53,7 @@ class PricedetailVoter extends ExtendedVoter
|
|||
$this->resolver->listOperationsForPermission('parts_prices')
|
||||
), true);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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 [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue