Skip to content

Commit

Permalink
Merge branch '5.3' into 5.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	core-bundle/contao/themes/flexible/backend.509d1d15.css
#	core-bundle/contao/themes/flexible/entrypoints.json
#	core-bundle/contao/themes/flexible/manifest.json
  • Loading branch information
leofeyer committed Jun 24, 2024
2 parents b3785a0 + 86cf7e1 commit b69b8f7
Showing 54 changed files with 792 additions and 864 deletions.
5 changes: 0 additions & 5 deletions config/listener.yaml
Original file line number Diff line number Diff line change
@@ -525,11 +525,6 @@ services:
arguments:
- '@monolog.logger.contao.error'

contao.messenger.worker_listener:
class: Contao\CoreBundle\Messenger\EventListener\WorkerListener
arguments:
- '@contao.messenger.auto_fallback_notifier'

contao.twig.loader.auto_refresh_template_hierarchy_listener:
class: Contao\CoreBundle\Twig\Loader\AutoRefreshTemplateHierarchyListener
arguments:
22 changes: 9 additions & 13 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -415,6 +415,7 @@ services:
contao.assets.files_context: '@contao.assets.files_context'
contao.routing.page_finder: '@contao.routing.page_finder'
contao.framework: '@contao.framework'
contao.filesystem.virtual.files: '@contao.filesystem.virtual.files'
event_dispatcher: '@event_dispatcher'
- '%kernel.project_dir%'
- '%contao.upload_path%'
@@ -472,7 +473,7 @@ services:
contao.insert_tag.resolver.if_language:
class: Contao\CoreBundle\InsertTag\Resolver\IfLanguageInsertTag
arguments:
- '@request_stack'
- '@translator'

contao.insert_tag.resolver.legacy:
class: Contao\CoreBundle\InsertTag\Resolver\LegacyInsertTag
@@ -549,23 +550,18 @@ services:
arguments:
- '@contao.menu.matcher'

contao.messenger.auto_fallback_notifier:
class: Contao\CoreBundle\Messenger\AutoFallbackNotifier
arguments:
- '@cache.app'
- '@messenger.receiver_locator'

contao.messenger.auto_fallback_transport_factory:
class: Contao\CoreBundle\Messenger\Transport\AutoFallbackTransportFactory
arguments:
- '@contao.messenger.auto_fallback_notifier'
- '@messenger.receiver_locator'

contao.messenger.search_index_message_handler:
class: Contao\CoreBundle\Messenger\MessageHandler\SearchIndexMessageHandler
arguments:
- '@?contao.search.indexer'

contao.messenger.web_worker:
class: Contao\CoreBundle\Messenger\WebWorker
arguments:
- '@cache.app'
- '@console.command.messenger_consume_messages'
- '@messenger.receiver_locator'

contao.model_argument_resolver:
class: Contao\CoreBundle\HttpKernel\ModelArgumentResolver
arguments:
2 changes: 0 additions & 2 deletions contao/dca/tl_article.php
Original file line number Diff line number Diff line change
@@ -101,8 +101,6 @@
(
'id' => array
(
'label' => array('ID'),
'search' => true,
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'pid' => array
3 changes: 1 addition & 2 deletions contao/dca/tl_content.php
Original file line number Diff line number Diff line change
@@ -167,8 +167,7 @@
(
'id' => array
(
'sql' => "int(10) unsigned NOT NULL auto_increment",
'search' => true
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'pid' => array
(
2 changes: 0 additions & 2 deletions contao/dca/tl_favorites.php
Original file line number Diff line number Diff line change
@@ -60,8 +60,6 @@
(
'id' => array
(
'label' => array('ID'),
'search' => true,
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'pid' => array
1 change: 0 additions & 1 deletion contao/dca/tl_module.php
Original file line number Diff line number Diff line change
@@ -106,7 +106,6 @@
(
'id' => array
(
'search' => true,
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'pid' => array
2 changes: 0 additions & 2 deletions contao/dca/tl_page.php
Original file line number Diff line number Diff line change
@@ -145,8 +145,6 @@
(
'id' => array
(
'label' => array('ID'),
'search' => true,
'sql' => "int(10) unsigned NOT NULL auto_increment"
),
'pid' => array
35 changes: 15 additions & 20 deletions contao/drivers/DC_Folder.php
Original file line number Diff line number Diff line change
@@ -602,24 +602,19 @@ public function showAll()
)) . ')</script>'
;

if (isset($GLOBALS['TL_DCA'][$this->strTable]['list']['global_operations']['toggleNodes']))
{
$return = '<div
data-controller="contao--toggle-nodes"
data-contao--toggle-nodes-toggle-action-value="toggleFileManager"
data-contao--toggle-nodes-load-action-value="loadFileManager"
data-contao--toggle-nodes-request-token-value="' . $requestToken . '"
data-contao--toggle-nodes-referer-id-value="' . $strRefererId . '"
data-contao--toggle-nodes-expand-value="' . $GLOBALS['TL_LANG']['MSC']['expandNode'] . '"
data-contao--toggle-nodes-collapse-value="' . $GLOBALS['TL_LANG']['MSC']['collapseNode'] . '"
data-contao--toggle-nodes-expand-all-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][0] . '"
data-contao--toggle-nodes-expand-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][1] . '"
data-contao--toggle-nodes-collapse-all-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
data-contao--toggle-nodes-collapse-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
>' . $return . '</div>';
}

return $return;
return '<div
data-controller="contao--toggle-nodes"
data-contao--toggle-nodes-toggle-action-value="toggleFileManager"
data-contao--toggle-nodes-load-action-value="loadFileManager"
data-contao--toggle-nodes-request-token-value="' . $requestToken . '"
data-contao--toggle-nodes-referer-id-value="' . $strRefererId . '"
data-contao--toggle-nodes-expand-value="' . $GLOBALS['TL_LANG']['MSC']['expandNode'] . '"
data-contao--toggle-nodes-collapse-value="' . $GLOBALS['TL_LANG']['MSC']['collapseNode'] . '"
data-contao--toggle-nodes-expand-all-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][0] . '"
data-contao--toggle-nodes-expand-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][1] . '"
data-contao--toggle-nodes-collapse-all-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
data-contao--toggle-nodes-collapse-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
>' . $return . '</div>';
}

/**
@@ -2748,7 +2743,7 @@ protected function generateTree($path, $intMargin, $mount=false, $blnProtected=t
}
}

$return .= '</div><div style="clear:both"></div></li>';
$return .= '</div></li>';

// Call the next node
if (!empty($content) && $blnIsOpen)
@@ -2849,7 +2844,7 @@ protected function generateTree($path, $intMargin, $mount=false, $blnProtected=t
}
}

$return .= $_buttons . '</div><div style="clear:both"></div></li>';
$return .= $_buttons . '</div></li>';
}

return $return;
50 changes: 27 additions & 23 deletions contao/drivers/DC_Table.php
Original file line number Diff line number Diff line change
@@ -392,6 +392,15 @@ public function showAll()
);

$objSession->set('CLIPBOARD', $arrClipboard);

if ($this->currentPid)
{
$this->redirect(Backend::addToUrl('id=' . $this->currentPid, false, array('act', 'mode')));
}
else
{
$this->redirect(Backend::addToUrl('', false, array('act', 'mode', 'id')));
}
}

// Custom filter
@@ -3950,7 +3959,7 @@ protected function treeView()
$breadcrumb = $GLOBALS['TL_DCA'][$table]['list']['sorting']['breadcrumb'] ?? '';

// Return if there are no records
if (!$tree && Input::get('act') != 'paste')
if (!$tree && !$blnClipboard)
{
if ($breadcrumb)
{
@@ -4092,25 +4101,20 @@ protected function treeView()
</form>';
}

if (isset($GLOBALS['TL_DCA'][$this->strTable]['list']['global_operations']['toggleNodes']))
{
$return = '<div
data-controller="contao--toggle-nodes"
data-contao--toggle-nodes-mode-value="' . (int) ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? 0) . '"
data-contao--toggle-nodes-toggle-action-value="toggleStructure"
data-contao--toggle-nodes-load-action-value="loadStructure"
data-contao--toggle-nodes-request-token-value="' . $requestToken . '"
data-contao--toggle-nodes-referer-id-value="' . $strRefererId . '"
data-contao--toggle-nodes-expand-value="' . $GLOBALS['TL_LANG']['MSC']['expandNode'] . '"
data-contao--toggle-nodes-collapse-value="' . $GLOBALS['TL_LANG']['MSC']['collapseNode'] . '"
data-contao--toggle-nodes-expand-all-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][0] . '"
data-contao--toggle-nodes-expand-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][1] . '"
data-contao--toggle-nodes-collapse-all-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
data-contao--toggle-nodes-collapse-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
>' . $return . '</div>';
}

return $return;
return '<div
data-controller="contao--toggle-nodes"
data-contao--toggle-nodes-mode-value="' . (int) ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? 0) . '"
data-contao--toggle-nodes-toggle-action-value="toggleStructure"
data-contao--toggle-nodes-load-action-value="loadStructure"
data-contao--toggle-nodes-request-token-value="' . $requestToken . '"
data-contao--toggle-nodes-referer-id-value="' . $strRefererId . '"
data-contao--toggle-nodes-expand-value="' . $GLOBALS['TL_LANG']['MSC']['expandNode'] . '"
data-contao--toggle-nodes-collapse-value="' . $GLOBALS['TL_LANG']['MSC']['collapseNode'] . '"
data-contao--toggle-nodes-expand-all-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][0] . '"
data-contao--toggle-nodes-expand-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['expandNodes'][1] . '"
data-contao--toggle-nodes-collapse-all-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
data-contao--toggle-nodes-collapse-all-title-value="' . $GLOBALS['TL_LANG']['DCA']['collapseNodes'][0] . '"
>' . $return . '</div>';
}

/**
@@ -4326,7 +4330,7 @@ protected function generateTree($table, $id, $arrPrevNext, $blnHasSorting, $intM
{
$mouseover = ' toggle_select hover-div';
}
elseif (($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? null) == self::MODE_TREE_EXTENDED && Input::get('act') == 'paste')
elseif (($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? null) == self::MODE_TREE_EXTENDED && $arrClipboard !== false)
{
$mouseover = ' hover-div';
}
@@ -4604,7 +4608,7 @@ protected function parentView()
<div class="tl_header click2edit toggle_select hover-div">';

// List all records of the child table
if (\in_array(Input::get('act'), array('paste', 'select', null)))
if (\in_array(Input::get('act'), array('select', null)))
{
// Header
$imagePasteNew = Image::getHtml('new.svg', $labelPasteNew[0]);
@@ -5501,7 +5505,7 @@ protected function listView()
*/
protected function searchMenu()
{
$searchFields = array();
$searchFields = array('id');

$objSessionBag = System::getContainer()->get('request_stack')->getSession()->getBag('contao_backend');
$session = $objSessionBag->all();
11 changes: 11 additions & 0 deletions contao/library/Contao/Database.php
Original file line number Diff line number Diff line change
@@ -157,6 +157,11 @@ public function query($strQuery)
/**
* Auto-generate a FIND_IN_SET() statement
*
* Do not pass user input as $strKey to this method as only identifiers get
* quoted and SQL expressions get returned as is!
*
* @internal Do not use this class in your code
*
* @param string $strKey The field name
* @param mixed $varSet The set to find the key in
* @param boolean $blnIsField If true, the set will not be quoted
@@ -657,6 +662,12 @@ public function getUuid()
/**
* Quote the column name if it is a reserved word
*
* Do not pass user input to this method as only identifiers get quoted and
* SQL expressions get returned as is!
*
* @internal Do not use this class in your code; use the "quoteIdentifier()"
* method of the "@database_connection" service instead
*
* @param string $strName
*
* @return string
8 changes: 7 additions & 1 deletion contao/library/Contao/StringUtil.php
Original file line number Diff line number Diff line change
@@ -607,9 +607,15 @@ public static function srcToInsertTag($data)
*/
public static function insertTagToSrc($data)
{
$return = '';
$paths = preg_split('/((src|href)="([^"]*){{file::([^"}|]+)[^"}]*}}")/i', $data, -1, PREG_SPLIT_DELIM_CAPTURE);

if (!$paths)
{
return $data;
}

$return = '';

for ($i=0, $c=\count($paths); $i<$c; $i+=5)
{
$return .= $paths[$i];
20 changes: 17 additions & 3 deletions contao/templates/forms/form_wrapper.html5
Original file line number Diff line number Diff line change
@@ -64,6 +64,10 @@ $this->wrapperAttributes = $this
// Send the triggered button data as well
if (e.submitter) {
formData.append(e.submitter.name, e.submitter.value);

// Prevent double form submission
e.submitter.disabled = true;
setTimeout(() => e.submitter.disabled = false, 30000);
}

request(form, formData, xhr => {
@@ -75,10 +79,10 @@ $this->wrapperAttributes = $this
return;
}

const template = document.createElement('template');
template.innerHTML = xhr.responseText.trim();
const range = document.createRange();
range.selectNode(form.parentNode);

const newForm = template.content.firstElementChild;
const newForm = range.createContextualFragment(xhr.responseText).firstElementChild;
form.replaceWith(newForm);

if (!newForm.getAttribute('action')) {
@@ -93,4 +97,14 @@ $this->wrapperAttributes = $this
initForm(el);
});
</script>
<?php else: ?>
<script<?= $this->attr()->setIfExists('nonce', $this->nonce('script-src')) ?>>
document.currentScript.previousElementSibling.querySelector('form').addEventListener('submit', e => {
// Prevent double form submission
if (e.submitter) {
e.submitter.disabled = true;
setTimeout(() => e.submitter.disabled = false, 30000);
}
});
</script>
<?php endif; ?>
1 change: 0 additions & 1 deletion contao/themes/flexible/backend.0e6e4e98.css.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions contao/themes/flexible/backend.ec1d4638.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contao/themes/flexible/entrypoints.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"entrypoints": {
"backend": {
"css": [
"/system/themes/flexible/backend.0e6e4e98.css"
"/system/themes/flexible/backend.ec1d4638.css"
]
},
"confirm": {
Loading

0 comments on commit b69b8f7

Please sign in to comment.