run fixVotes in migration (only needed once)
Signed-off-by: dartcafe <github@dartcafe.de>
This commit is contained in:
Родитель
2062843b4d
Коммит
79bea2ecdd
|
@ -38,7 +38,6 @@
|
|||
<pre-migration>
|
||||
<step>OCA\Polls\Migration\RemoveIndices</step>
|
||||
<step>OCA\Polls\Migration\DeleteInvalidRecords</step>
|
||||
<step>OCA\Polls\Migration\FixVotes</step>
|
||||
</pre-migration>
|
||||
<post-migration>
|
||||
<step>OCA\Polls\Migration\CreateIndices</step>
|
||||
|
|
|
@ -140,11 +140,11 @@ class Option extends Entity implements JsonSerializable {
|
|||
}
|
||||
|
||||
public function getPollOptionTextEnd(): string {
|
||||
if ($this->getTimestamp()) {
|
||||
return date('c', $this->getTimestamp() + $this->getDuration());
|
||||
}
|
||||
return htmlspecialchars_decode($this->pollOptionText);
|
||||
if ($this->getTimestamp()) {
|
||||
return date('c', $this->getTimestamp() + $this->getDuration());
|
||||
}
|
||||
return htmlspecialchars_decode($this->pollOptionText);
|
||||
}
|
||||
|
||||
public function getPollOptionTextStart(): string {
|
||||
if ($this->getTimestamp()) {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Julius Härtl <jus@bitgrid.net>
|
||||
* @copyright Copyright (c) 2021 René Gieling <github@dartcafe.de>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
* @author René Gieling <github@dartcafe.de>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2017 Julius Härtl <jus@bitgrid.net>
|
||||
* @copyright Copyright (c) 2021 René Gieling <github@dartcafe.de>
|
||||
*
|
||||
* @author Julius Härtl <jus@bitgrid.net>
|
||||
* @author René Gieling <github@dartcafe.de>
|
||||
*
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
|
|
|
@ -45,9 +45,13 @@ class Version030000Date20210611120000 extends SimpleMigrationStep {
|
|||
/** @var IConfig */
|
||||
protected $config;
|
||||
|
||||
public function __construct(IDBConnection $connection, IConfig $config) {
|
||||
/** @var FixVotes */
|
||||
protected $fixVotes;
|
||||
|
||||
public function __construct(IDBConnection $connection, IConfig $config, FixVotes $fixVotes) {
|
||||
$this->connection = $connection;
|
||||
$this->config = $config;
|
||||
$this->fixVotes = $fixVotes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,6 +73,8 @@ class Version030000Date20210611120000 extends SimpleMigrationStep {
|
|||
// theoretically, only this migration should be existen. If not, no matter
|
||||
TableSchema::removeObsoleteMigrations($this->connection, $output);
|
||||
|
||||
$this->fixVotes->run($output);
|
||||
|
||||
return $schema;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче