Skip to content

Commit

Permalink
Fix importing rss_displayer blocks from CIF files
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Nov 23, 2023
1 parent 00cefc1 commit ff24fa1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
21 changes: 21 additions & 0 deletions concrete/blocks/rss_displayer/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,25 @@ public function getSearchableContent()

return $searchContent;
}

/**
* {@inheritdoc}
*
* @see \Concrete\Core\Block\BlockController::getImportData()
*/
protected function getImportData($blockNode, $page)
{
$data = parent::getImportData($blockNode, $page);
$dateFormat = $data['dateFormat'] ?? '';
if ($dateFormat !== '') {
if (array_key_exists($dateFormat, $this->getDefaultDateTimeFormats())) {
$data['standardDateFormat'] = $dateFormat;
} else {
$data['customDateFormat'] = $dateFormat;
}
}
unset($data['dateFormat']);

return $data;
}
}
4 changes: 2 additions & 2 deletions concrete/config/install/base/single_pages/dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,7 @@
<record>
<title>Tutorials</title>
<url>https://documentation.concretecms.org/rss/tutorials</url>
<dateFormat>longDate</dateFormat>
<dateFormat>:longDate:</dateFormat>
<itemsToDisplay>1</itemsToDisplay>
<showSummary>1</showSummary>
<launchInNewWindow>1</launchInNewWindow>
Expand All @@ -1625,7 +1625,7 @@
<record>
<title>News from concretecms.com</title>
<url>https://www.concretecms.com/rss/blog</url>
<dateFormat>longDate</dateFormat>
<dateFormat>:longDate:</dateFormat>
<itemsToDisplay>3</itemsToDisplay>
<showSummary>1</showSummary>
<launchInNewWindow>1</launchInNewWindow>
Expand Down
4 changes: 2 additions & 2 deletions concrete/config/install/upgrade/desktops.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<record>
<title>Tutorials</title>
<url>http://documentation.concretecms.org/rss/tutorials</url>
<dateFormat>longDate</dateFormat>
<dateFormat>:longDate:</dateFormat>
<itemsToDisplay>1</itemsToDisplay>
<showSummary>1</showSummary>
<launchInNewWindow>1</launchInNewWindow>
Expand Down Expand Up @@ -105,7 +105,7 @@
<record>
<title>News from Concrete</title>
<url>http://www.concretecms.com/rss/blog</url>
<dateFormat>longDate</dateFormat>
<dateFormat>:longDate:</dateFormat>
<itemsToDisplay>3</itemsToDisplay>
<showSummary>1</showSummary>
<launchInNewWindow>1</launchInNewWindow>
Expand Down

0 comments on commit ff24fa1

Please sign in to comment.