Skip to content

Commit d0b03bf

Browse files
Merge branch 'fixProblem330-789' into 'stable-3_3_0'
Corrige problema de quando submissão não possui títulos - 3.3.0 See merge request softwares-pkp/plugins_ojs/relatorioscielo!35
2 parents 687e52b + 20d0b99 commit d0b03bf

7 files changed

Lines changed: 40 additions & 5 deletions

File tree

classes/ScieloSubmission.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ public function getId(): int
5656

5757
public function getTitle(): string
5858
{
59-
return preg_replace('/\s+/', ' ', $this->title);
59+
$this->title = preg_replace('/\s+/', ' ', $this->title);
60+
$messageNoTitles = __("plugins.reports.scieloSubmissionsReport.warning.noTitles");
61+
62+
return $this->fillEmptyFields($this->title, $messageNoTitles);
6063
}
6164

6265
public function getSubmitter(): string

classes/ScieloSubmissionsDAO.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public function getPublicationTitle($publicationId, $locale, $submissionLocale)
8484
$titles[$locale] = $title;
8585
}
8686

87+
if (empty($titles)) {
88+
return '';
89+
}
90+
8791
if (array_key_exists($locale, $titles)) {
8892
return $titles[$locale];
8993
}

locale/en_US/locale.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ msgstr ""
5858
"The report generation proccesss can take a few minutes, depending on the parameters selected and the number of submissions present in the system. "
5959
"In case it lasts longer, please contact the support team."
6060

61+
msgid "plugins.reports.scieloSubmissionsReport.warning.noTitles"
62+
msgstr "No titles"
63+
6164
msgid "plugins.reports.scieloSubmissionsReport.warning.noResponsibles"
6265
msgstr "No responsibles assigned"
6366

locale/es_ES/locale.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ msgstr ""
5858
"El proceso de generación de informes puede tardar unos minutos, según los parámetros seleccionados y la cantidad de envíos presentes en el sistema. "
5959
"Si la demora dura más, comuníquese con el equipo de soporte."
6060

61+
msgid "plugins.reports.scieloSubmissionsReport.warning.noTitles"
62+
msgstr "Sin títulos"
63+
6164
msgid "plugins.reports.scieloSubmissionsReport.warning.noResponsibles"
6265
msgstr "Sin responsables designados"
6366

locale/pt_BR/locale.po

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ msgstr ""
5858
"O processo de geração do relatório pode demorar poucos minutos, dependendo do parâmetros selecionados e do número de submissões presentes no sistema. "
5959
"Caso a demora se estenda por mais tempo, contate a equipe de suporte."
6060

61+
msgid "plugins.reports.scieloSubmissionsReport.warning.noTitles"
62+
msgstr "Sem títulos"
63+
6164
msgid "plugins.reports.scieloSubmissionsReport.warning.noResponsibles"
6265
msgstr "Sem responsáveis designados"
6366

tests/ScieloArticleFactoryTest.php

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class ScieloArticleFactoryTest extends DatabaseTestCase
1212
{
1313
private $locale = 'en_US';
1414
private $contextId = 1;
15+
private $sectionId;
1516
private $submissionId;
1617
private $publicationId;
1718
private $title = "eXtreme Programming: A practical guide";
@@ -27,9 +28,9 @@ class ScieloArticleFactoryTest extends DatabaseTestCase
2728
public function setUp(): void
2829
{
2930
parent::setUp();
30-
$sectionId = $this->createSection();
31+
$this->sectionId = $this->createSection();
3132
$this->submissionId = $this->createSubmission();
32-
$this->publicationId = $this->createPublication($sectionId);
33+
$this->publicationId = $this->createPublication($this->sectionId);
3334
$this->submissionAuthors = $this->createAuthors();
3435
$this->statusMessage = __('submission.status.published', [], 'en_US');
3536
$this->addCurrentPublicationToSubmission();
@@ -210,6 +211,24 @@ public function testSubmissionIsArticle(): void
210211
$this->assertTrue($scieloArticle instanceof ScieloArticle);
211212
}
212213

214+
/**
215+
* @group OJS
216+
*/
217+
public function testArticleCreationWhenItHasNoTitles(): void
218+
{
219+
$this->title = null;
220+
$this->submissionId = $this->createSubmission();
221+
$this->publicationId = $this->createPublication($this->sectionId);
222+
$this->submissionAuthors = $this->createAuthors();
223+
$this->addCurrentPublicationToSubmission();
224+
225+
$articleFactory = new ScieloArticleFactory();
226+
$scieloArticle = $articleFactory->createSubmission($this->submissionId, $this->locale);
227+
228+
$this->assertTrue($scieloArticle instanceof ScieloArticle);
229+
$this->assertEquals(__('plugins.reports.scieloSubmissionsReport.warning.noTitles'), $scieloArticle->getTitle());
230+
}
231+
213232
/**
214233
* @group OJS
215234
*/

version.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<version>
55
<application>scieloSubmissionsReport</application>
66
<type>plugins.reports</type>
7-
<release>2.4.5.1</release>
8-
<date>2025-05-27</date>
7+
<release>2.4.6.0</release>
8+
<date>2025-06-24</date>
99
<lazy-load>1</lazy-load>
1010
<class>ScieloSubmissionsReportPlugin</class>
1111
</version>

0 commit comments

Comments
 (0)