Sfoglia il codice sorgente

Topic with a poll cannot be attached to another topic

Visman 2 anni fa
parent
commit
3e659812ca
3 ha cambiato i file con 15 aggiunte e 0 eliminazioni
  1. 9 0
      app/Models/Pages/Moderate.php
  2. 3 0
      app/lang/en/misc.po
  3. 3 0
      app/lang/ru/misc.po

+ 9 - 0
app/Models/Pages/Moderate.php

@@ -440,6 +440,15 @@ class Moderate extends Page
             }
         }
 
+        foreach ($topics as $topic) {
+            if (
+                $this->firstTopic !== $topic
+                && $topic->poll_type > 0
+            ) {
+                return $this->c->Message->message('Poll cannot be attached');
+            }
+        }
+
         switch ($v->step) {
             case 1:
                 $this->formTitle   = 'Merge topics title';

+ 3 - 0
app/lang/en/misc.po

@@ -267,3 +267,6 @@ msgstr "When sending email there was an error. Please try again later."
 
 msgid "Confirm your email address"
 msgstr "First, please <a href=\"%s\">confirm</a> your email address."
+
+msgid "Poll cannot be attached"
+msgstr "Topic with a poll cannot be attached to another topic."

+ 3 - 0
app/lang/ru/misc.po

@@ -287,3 +287,6 @@ msgstr "При отправке письма возникла ошибка. По
 
 msgid "Confirm your email address"
 msgstr "Вначале, пожалуйста, <a href=\"%s\">подтвердите</a> свой электронный адрес."
+
+msgid "Poll cannot be attached"
+msgstr "Тему с опросом нельзя прикрепить к другой теме."