Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Changelog
All notable changes to this project will be documented in this file.

## [8.3.1] - 2025-08-22
- Fix migration from 7.x to 8.x
## [8.3.3] - 2025-08-24
- Fix migration

### Fixed (v8.3.0)
- Made description sticky again on horizontal scrolling
Expand All @@ -27,6 +27,9 @@ All notable changes to this project will be documented in this file.
- Make comments available to owner and delegated poll administration if commenting is disabled
- Add hint, if commenting is disabled

## [8.3.2] - 2025-08-22
- Fix migration from 7.x to 8.x

## [8.3.0] - 2025-08-21
If you experience update problems, please refer to [this article](https://github.com/nextcloud/polls/wiki/Installation-help#update-issues)

Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Polls</name>
<summary>A polls app, similar to Doodle/DuD-Poll with the possibility to restrict access.</summary>
<description>A polls app, similar to Doodle/DuD-Poll with the possibility to restrict access (members, certain groups/users, hidden and public).</description>
<version>8.3.2</version>
<version>8.3.3-alpha.2</version>
<licence>agpl</licence>
<author>Vinzenz Rosenkranz</author>
<author>René Gieling</author>
Expand Down
3 changes: 3 additions & 0 deletions l10n/be.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ OC.L10N.register(
"Participants" : "Удзельнікі",
"Email address" : "Адрас электроннай пошты",
"OK" : "OK",
"Duration" : "Працягласць",
"Preview" : "Перадпрагляд",
"Submit" : "Адправіць",
"{optionText} already exists" : "{optionText} ужо існуе",
"never" : "ніколі",
Expand All @@ -41,6 +43,7 @@ OC.L10N.register(
"Comments" : "Каментарыі",
"Sharing" : "Абагульванне",
"Activity" : "Актыўнасць",
"Access" : "Доступ",
"Owner" : "Уладальнік"
},
"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);");
3 changes: 3 additions & 0 deletions l10n/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"Participants" : "Удзельнікі",
"Email address" : "Адрас электроннай пошты",
"OK" : "OK",
"Duration" : "Працягласць",
"Preview" : "Перадпрагляд",
"Submit" : "Адправіць",
"{optionText} already exists" : "{optionText} ужо існуе",
"never" : "ніколі",
Expand All @@ -39,6 +41,7 @@
"Comments" : "Каментарыі",
"Sharing" : "Абагульванне",
"Activity" : "Актыўнасць",
"Access" : "Доступ",
"Owner" : "Уладальнік"
},"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"
}
5 changes: 5 additions & 0 deletions l10n/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,13 @@ OC.L10N.register(
"Delete comment" : "Elimina commento",
"deleted" : "eliminato",
"The automatic reminder is sent to all shares via email:" : "La promemoria automatica viene inviato a tutte le condivisioni via email:",
"For polls with expiration" : "Per sondaggi con scadenza",
"48 hours before the expiration date, if the poll is created more than 5 days before the expiration." : "48 ore prima della data di scadenza, se il sondaggio viene creato più di 5 giorni prima della scadenza.",
"36 hours before the expiration date, if the poll is created more than 2 and less than 5 days before the expiration." : "36 ore prima della data di scadenza, se il sondaggio viene creato più di 2 e meno di 5 giorni prima della scadenza.",
"For date polls without expiration" : "Per sondaggi con data senza scadenza",
"48 hours before the first date option, if the poll is created more than 5 days before the first date option." : "48 ore prima dell'opzione della prima data, se il sondaggio viene creato più di 5 giorni prima dell'opzione della prima data.",
"36 hours before the first date option, if the poll is created more than 2 and less than 5 days before the first date option." : "36 ore prima dell'opzione prima data, se il sondaggio viene creato più di 2 e meno di 5 giorni prima dell'opzione prima data.",
"No reminder is sent" : "Nessun promemoria inviato",
"For text polls without expiration." : "Per sondaggi di testo senza scadenza.",
"For polls created less than 2 days before the expiration." : "Per i sondaggi creati meno di 2 giorni prima della scadenza.",
"If a share already got a reminder (no matter, if the expiration date got changed)." : "Se una condivisione ha già ricevuto un promemoria (indipendentemente dal fatto che la data di scadenza sia stata modificata).",
Expand Down Expand Up @@ -605,8 +608,10 @@ OC.L10N.register(
"No comments" : "Nessun commento",
"Be the first." : "Sii il primo.",
"Configuration" : "Configurazione",
"Comments are disabled, except for owner and delegated poll administration." : "I commenti sono disabilitati, ad eccezione per l' amministrazione del sondaggio, del proprietario e dei delegati.",
"You have been granted administrative rights." : "Ti sono stati concessi diritti amministrativi.",
"Changes may affect existing votes." : "Le modifiche potrebbero avere ripercussioni sulle votazioni esistenti.",
"Poll configuration" : "Configurazione del sondaggio",
"Poll closing status" : "Stato di chiusura dei sondaggi",
"Result display" : "Visualizzazione dei risultati",
"Deletion and owner" : "Cancellazione e proprietario",
Expand Down
5 changes: 5 additions & 0 deletions l10n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,13 @@
"Delete comment" : "Elimina commento",
"deleted" : "eliminato",
"The automatic reminder is sent to all shares via email:" : "La promemoria automatica viene inviato a tutte le condivisioni via email:",
"For polls with expiration" : "Per sondaggi con scadenza",
"48 hours before the expiration date, if the poll is created more than 5 days before the expiration." : "48 ore prima della data di scadenza, se il sondaggio viene creato più di 5 giorni prima della scadenza.",
"36 hours before the expiration date, if the poll is created more than 2 and less than 5 days before the expiration." : "36 ore prima della data di scadenza, se il sondaggio viene creato più di 2 e meno di 5 giorni prima della scadenza.",
"For date polls without expiration" : "Per sondaggi con data senza scadenza",
"48 hours before the first date option, if the poll is created more than 5 days before the first date option." : "48 ore prima dell'opzione della prima data, se il sondaggio viene creato più di 5 giorni prima dell'opzione della prima data.",
"36 hours before the first date option, if the poll is created more than 2 and less than 5 days before the first date option." : "36 ore prima dell'opzione prima data, se il sondaggio viene creato più di 2 e meno di 5 giorni prima dell'opzione prima data.",
"No reminder is sent" : "Nessun promemoria inviato",
"For text polls without expiration." : "Per sondaggi di testo senza scadenza.",
"For polls created less than 2 days before the expiration." : "Per i sondaggi creati meno di 2 giorni prima della scadenza.",
"If a share already got a reminder (no matter, if the expiration date got changed)." : "Se una condivisione ha già ricevuto un promemoria (indipendentemente dal fatto che la data di scadenza sia stata modificata).",
Expand Down Expand Up @@ -603,8 +606,10 @@
"No comments" : "Nessun commento",
"Be the first." : "Sii il primo.",
"Configuration" : "Configurazione",
"Comments are disabled, except for owner and delegated poll administration." : "I commenti sono disabilitati, ad eccezione per l' amministrazione del sondaggio, del proprietario e dei delegati.",
"You have been granted administrative rights." : "Ti sono stati concessi diritti amministrativi.",
"Changes may affect existing votes." : "Le modifiche potrebbero avere ripercussioni sulle votazioni esistenti.",
"Poll configuration" : "Configurazione del sondaggio",
"Poll closing status" : "Stato di chiusura dei sondaggi",
"Result display" : "Visualizzazione dei risultati",
"Deletion and owner" : "Cancellazione e proprietario",
Expand Down
5 changes: 5 additions & 0 deletions l10n/uk.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,13 @@ OC.L10N.register(
"Delete comment" : "Вилучити коментар",
"deleted" : "вилучено",
"The automatic reminder is sent to all shares via email:" : "Автоматичний лист-нагадування було надіслано всім, хто має права спільного доступу:",
"For polls with expiration" : "Для опитувань з терміном дії",
"48 hours before the expiration date, if the poll is created more than 5 days before the expiration." : "За 48 годин до закінчення терміну дії, якщо опитування створено більш ніж за 5 днів до закінчення терміну дії.",
"36 hours before the expiration date, if the poll is created more than 2 and less than 5 days before the expiration." : "За 36 годин до закінчення терміну дії, якщо опитування створено більше ніж за 2 і менше ніж за 5 днів до закінчення терміну дії.",
"For date polls without expiration" : "Для опитувань з датою без терміну дії",
"48 hours before the first date option, if the poll is created more than 5 days before the first date option." : "За 48 годин до першого варіанту дати, якщо опитування створюється більш ніж за 5 днів до першого варіанту дати.",
"36 hours before the first date option, if the poll is created more than 2 and less than 5 days before the first date option." : "За 36 годин до першої дати, якщо опитування створено більше ніж за 2 і менше ніж за 5 днів до першої дати.",
"No reminder is sent" : "Нагадування не надсилається",
"For text polls without expiration." : "Для текстових опитувань без обмеження терміну дії.",
"For polls created less than 2 days before the expiration." : "Для опитувань, створених менш ніж за 2 дні до закінчення терміну дії.",
"If a share already got a reminder (no matter, if the expiration date got changed)." : "Якщо акція вже отримувала нагадування (незалежно від того, чи була змінена дата закінчення терміну дії).",
Expand Down Expand Up @@ -605,8 +608,10 @@ OC.L10N.register(
"No comments" : "Нема коментарів",
"Be the first." : "Будьте першим.",
"Configuration" : "Налаштування",
"Comments are disabled, except for owner and delegated poll administration." : "Коментарі вимкнені, за винятком власника та делегованого адміністратора опитування.",
"You have been granted administrative rights." : "Ви отримали адміністративні права.",
"Changes may affect existing votes." : "Зміни можуть вплинути на існуючі голоси.",
"Poll configuration" : "Налаштування опитування",
"Poll closing status" : "Статус закриття опитування",
"Result display" : "Показ результатів",
"Deletion and owner" : "Видалення та власник",
Expand Down
5 changes: 5 additions & 0 deletions l10n/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,13 @@
"Delete comment" : "Вилучити коментар",
"deleted" : "вилучено",
"The automatic reminder is sent to all shares via email:" : "Автоматичний лист-нагадування було надіслано всім, хто має права спільного доступу:",
"For polls with expiration" : "Для опитувань з терміном дії",
"48 hours before the expiration date, if the poll is created more than 5 days before the expiration." : "За 48 годин до закінчення терміну дії, якщо опитування створено більш ніж за 5 днів до закінчення терміну дії.",
"36 hours before the expiration date, if the poll is created more than 2 and less than 5 days before the expiration." : "За 36 годин до закінчення терміну дії, якщо опитування створено більше ніж за 2 і менше ніж за 5 днів до закінчення терміну дії.",
"For date polls without expiration" : "Для опитувань з датою без терміну дії",
"48 hours before the first date option, if the poll is created more than 5 days before the first date option." : "За 48 годин до першого варіанту дати, якщо опитування створюється більш ніж за 5 днів до першого варіанту дати.",
"36 hours before the first date option, if the poll is created more than 2 and less than 5 days before the first date option." : "За 36 годин до першої дати, якщо опитування створено більше ніж за 2 і менше ніж за 5 днів до першої дати.",
"No reminder is sent" : "Нагадування не надсилається",
"For text polls without expiration." : "Для текстових опитувань без обмеження терміну дії.",
"For polls created less than 2 days before the expiration." : "Для опитувань, створених менш ніж за 2 дні до закінчення терміну дії.",
"If a share already got a reminder (no matter, if the expiration date got changed)." : "Якщо акція вже отримувала нагадування (незалежно від того, чи була змінена дата закінчення терміну дії).",
Expand Down Expand Up @@ -603,8 +606,10 @@
"No comments" : "Нема коментарів",
"Be the first." : "Будьте першим.",
"Configuration" : "Налаштування",
"Comments are disabled, except for owner and delegated poll administration." : "Коментарі вимкнені, за винятком власника та делегованого адміністратора опитування.",
"You have been granted administrative rights." : "Ви отримали адміністративні права.",
"Changes may affect existing votes." : "Зміни можуть вплинути на існуючі голоси.",
"Poll configuration" : "Налаштування опитування",
"Poll closing status" : "Статус закриття опитування",
"Result display" : "Показ результатів",
"Deletion and owner" : "Видалення та власник",
Expand Down
1 change: 1 addition & 0 deletions lib/Command/Db/Rebuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private function fixNullish(): void {
$messages = $this->tableManager->fixNullishPollGroupRelations();
$this->printInfo($messages, ' ');
}

/**
* Create index for $table
*/
Expand Down
70 changes: 10 additions & 60 deletions lib/Db/V2/TableManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

class TableManager extends DbManager {

// private string $dbPrefix;
// private Schema|ISchemaWrapper $schema;

/** @psalm-suppress PossiblyUnusedMethod */
public function __construct(
protected IConfig $config,
Expand All @@ -41,27 +38,8 @@ public function __construct(
private VoteMapper $voteMapper,
) {
parent::__construct($config, $connection);
// $this->dbPrefix = $this->config->getSystemValue('dbtableprefix', 'oc_');
}

// public function setSchema(Schema|ISchemaWrapper &$schema): void {
// $this->schema = $schema;
// }

// public function createSchema(): Schema {
// $this->schema = $this->connection->createSchema();
// return $this->schema;
// }
// public function migrateToSchema() : void {
// // Schema must be of class Schema
// $this->needsSchema(iSchemWrapperClass: false);
// $this->connection->migrateToSchema($this->schema);
// }

// public function setConnection(IDBConnection &$connection): void {
// $this->connection = $connection;
// }

/**
* @return string[]
*
Expand Down Expand Up @@ -464,23 +442,22 @@ public function fixNullishShares(): array {
$query = $this->connection->getQueryBuilder();
$schema = $this->connection->createSchema();

if (!$schema->hasTable(Share::TABLE)) {
$messages[] = 'Table ' . Share::TABLE . ' does not exist';
if (!$schema->hasTable($this->dbPrefix . Share::TABLE)) {
$messages[] = 'Table ' . $this->dbPrefix . Share::TABLE . ' does not exist';
return $messages;
}

$table = $schema->getTable(Share::TABLE);
$table = $schema->getTable($this->dbPrefix . Share::TABLE);

if ($table->hasColumn('group_id')) {
// replace all nullish group_ids with 0 in share table
$query->update(Share::TABLE)
->set('group_id', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT))
->where($query->expr()->isNull('group_id'));

$count = $query->executeStatement();

if ($count > 0) {
$messages[] = 'Updated ' . $count . ' shares and set group_id to 0 for nullish values';
$messages[] = 'Updated ' . $count . ' shares with nullish group_id and set group_id to 0';
}
}

Expand All @@ -506,6 +483,12 @@ public function fixNullishShares(): array {
public function fixNullishPollGroupRelations(): array {
$messages = [];
$query = $this->connection->getQueryBuilder();
$schema = $this->connection->createSchema();

if (!$schema->hasTable($this->dbPrefix . PollGroup::RELATION_TABLE)) {
$messages[] = 'Table ' . $this->dbPrefix . PollGroup::RELATION_TABLE . ' does not exist';
return $messages;
}

// replace all nullish group_ids with 0 in share table
$query->update(PollGroup::RELATION_TABLE)
Expand Down Expand Up @@ -611,37 +594,4 @@ public function migrateOptionsToHash(): array {
}
return $messages;
}

// protected function getTableName(string $tableName): ?string {
// if ($this->schema instanceof Schema) {
// // If the schema is an instance of Schema, we need to prefix the table name
// return $this->config->getSystemValue('dbtableprefix', 'oc_') . $tableName;
// }
// return $tableName;
// }

// protected function needsSchema(bool $schemaClass = true, bool $iSchemWrapperClass = true): void {
// if (($this->schema instanceof Schema) && $schemaClass) {
// return;
// }

// if (($this->schema instanceof ISchemaWrapper) && $iSchemWrapperClass) {
// return;
// }

// if ($schemaClass && $iSchemWrapperClass) {
// // If the schema is not set or not an instance of Schema or ISchemaWrapper, throw an exception
// throw new Exception('Schema is not set or not an instance of Schema or ISchemaWrapper');
// }
// if ($schemaClass) {
// // If the schema is not set or not an instance of Schema, throw an exception
// throw new Exception('Schema is not set or not an instance of Schema');
// }
// if ($iSchemWrapperClass) {
// // If the schema is not set or not an instance of ISchemaWrapper, throw an exception
// throw new Exception('Schema is not set or not an instance of ISchemaWrapper');
// }
// throw new Exception('Unexpected. Schema is an instance of ' . get_class($this->schema));
// }

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @psalm-suppress UnusedClass
*/
class Version080301Date20250822182903 extends SimpleMigrationStep {
class Version080303Date20250824090101 extends SimpleMigrationStep {
private ISchemaWrapper $schema;
private ?IOutput $output = null;

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading