Skip to content

Commit

Permalink
Merge branch '4.x' of github.com:contao/contao into feature/language-…
Browse files Browse the repository at this point in the history
…dependent-module-configuration
  • Loading branch information
bytehead committed Dec 30, 2021
2 parents 127497d + 6a815a4 commit 243920b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 6 additions & 0 deletions calendar-bundle/src/Resources/contao/classes/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ protected function generateFiles($arrFeed)
{
while ($objArticle->next())
{
// Never add unpublished elements to the RSS feeds
if (!$objArticle->published || ($objArticle->start && $objArticle->start > $time) || ($objArticle->stop && $objArticle->stop <= $time))
{
continue;
}

$jumpTo = $objArticle->getRelated('pid')->jumpTo;

// No jumpTo page set (see #4784)
Expand Down
6 changes: 5 additions & 1 deletion core-bundle/src/Command/UserListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function configure(): void
$this
->addOption('column', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'The columns display in the table')
->addOption('admins', null, InputOption::VALUE_NONE, 'Return only admins')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'text')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, json)', 'txt')
->setDescription('Lists Contao back end users.')
;
}
Expand All @@ -62,6 +62,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int

switch ($input->getOption('format')) {
case 'text':
trigger_deprecation('contao/core-bundle', '4.13', 'Using --format=text is deprecated and will be removed in Contao 5. Use --format=txt instead.');
// no break

case 'txt':
if (0 === $users->count()) {
$io->note('No accounts found.');

Expand Down
8 changes: 7 additions & 1 deletion news-bundle/src/Resources/contao/classes/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ protected function generateFiles($arrFeed)
if ($objArticle !== null)
{
$arrUrls = array();

$request = $container->get('request_stack')->getCurrentRequest();

if ($request)
Expand All @@ -155,10 +154,17 @@ protected function generateFiles($arrFeed)
$request->attributes->set('_scope', 'frontend');
}

$time = time();
$origObjPage = $GLOBALS['objPage'] ?? null;

while ($objArticle->next())
{
// Never add unpublished elements to the RSS feeds
if (!$objArticle->published || ($objArticle->start && $objArticle->start > $time) || ($objArticle->stop && $objArticle->stop <= $time))
{
continue;
}

$jumpTo = $objArticle->getRelated('pid')->jumpTo;

// No jumpTo page set (see #4784)
Expand Down
3 changes: 1 addition & 2 deletions news-bundle/src/Resources/contao/models/NewsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,7 @@ public static function findPublishedByPids($arrPids, $blnFeatured=null, $intLimi
$arrColumns[] = "$t.featured=''";
}

// Never return unpublished elements in the back end, so they don't end up in the RSS feed
if (!static::isPreviewMode($arrOptions) || TL_MODE == 'BE')
if (!static::isPreviewMode($arrOptions))
{
$time = Date::floorToMinute();
$arrColumns[] = "$t.published='1' AND ($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'$time')";
Expand Down

0 comments on commit 243920b

Please sign in to comment.