Skip to content

Commit

Permalink
Merge pull request #42591 from bembelimen/5.0/upmerge-2024-01-02
Browse files Browse the repository at this point in the history
[5.0] Upmerge 2024-01-02
  • Loading branch information
bembelimen authored Jan 2, 2024
2 parents adbdb7f + cfed3e1 commit 6be3854
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -879,8 +879,8 @@ public function &getSource()
$fileName = str_replace('//', '/', $fileName);
$isMedia = $input->getInt('isMedia', 0);

$fileName = $isMedia ? Path::clean(JPATH_ROOT . '/media/templates/' . ($this->template->client_id === 0 ? 'site' : 'administrator') . '/' . $this->template->element . $fileName)
: Path::clean(JPATH_ROOT . ($this->template->client_id === 0 ? '' : '/administrator') . '/templates/' . $this->template->element . $fileName);
$fileName = $isMedia ? Path::clean(JPATH_ROOT . '/media/templates/' . ((int) $this->template->client_id === 0 ? 'site' : 'administrator') . '/' . $this->template->element . $fileName)
: Path::clean(JPATH_ROOT . ((int) $this->template->client_id === 0 ? '' : '/administrator') . '/templates/' . $this->template->element . $fileName);

try {
$filePath = Path::check($fileName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<div class="row mt-2">
<div class="col-md-8" id="conditional-section">
<?php if ($this->type != 'home') : ?>
<p class="lead"><?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_FILENAME', '&#x200E;' . ($input->get('isMedia', 0) ? '/media/templates/' . ($this->template->client_id === 0 ? 'site' : 'administrator') . '/' . $this->template->element . str_replace('//', '/', base64_decode($this->file)) : '/' . ($this->template->client_id === 0 ? '' : 'administrator/') . 'templates/' . $this->template->element . str_replace('//', '/', base64_decode($this->file))), $this->template->element); ?></p>
<p class="lead"><?php echo Text::sprintf('COM_TEMPLATES_TEMPLATE_FILENAME', '&#x200E;' . ($input->get('isMedia', 0) ? '/media/templates/' . ((int) $this->template->client_id === 0 ? 'site' : 'administrator') . '/' . $this->template->element . str_replace('//', '/', base64_decode($this->file)) : '/' . ((int) $this->template->client_id === 0 ? '' : 'administrator/') . 'templates/' . $this->template->element . str_replace('//', '/', base64_decode($this->file))), $this->template->element); ?></p>
<p class="lead path hidden"><?php echo $this->source->filename; ?></p>
<?php endif; ?>
</div>
Expand All @@ -80,7 +80,7 @@
<li class="folder-select">
<a class="folder-url" data-id="" href="">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo ($this->template->client_id === 0 ? '/' : '/administrator/') . 'templates/' . $this->template->element; ?>
<?php echo ((int) $this->template->client_id === 0 ? '/' : '/administrator/') . 'templates/' . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('tree'); ?>
</li>
Expand All @@ -90,7 +90,7 @@
<li class="folder-select">
<a class="folder-url" data-id="" href="">
<span class="icon-folder icon-fw" aria-hidden="true"></span>
<?php echo '/media/templates/' . ($this->template->client_id === 0 ? 'site/' : 'administrator/') . $this->template->element; ?>
<?php echo '/media/templates/' . ((int) $this->template->client_id === 0 ? 'site/' : 'administrator/') . $this->template->element; ?>
</a>
<?php echo $this->loadTemplate('tree_media'); ?>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ protected function preprocessSaveData(array $data): array
}
}

$tags = new TagsHelper();
$tags->getTagIds($data['id'], 'com_content.article');
$data['tags'] = explode(',', $tags->tags);
if (($this->input->getMethod() === 'PATCH') && !(\array_key_exists('tags', $data))) {
$tags = new TagsHelper();
$tags->getTagIds($data['id'], 'com_content.article');
$data['tags'] = explode(',', $tags->tags);
}

return $data;
}
Expand Down
22 changes: 16 additions & 6 deletions libraries/src/Extension/ExtensionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,25 @@ public static function getCoreExtensionIds()
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'));

$values = [];

foreach (self::$coreExtensions as $extension) {
$values = $query->bindArray($extension, [ParameterType::STRING, ParameterType::STRING, ParameterType::STRING, ParameterType::INTEGER]);
$query->where(
'(' . $db->quoteName('type') . ' = ' . $values[0] . ' AND ' . $db->quoteName('element') . ' = ' . $values[1]
. ' AND ' . $db->quoteName('folder') . ' = ' . $values[2] . ' AND ' . $db->quoteName('client_id') . ' = ' . $values[3] . ')',
'OR'
);
$values[] = $extension[0] . '|' . $extension[1] . '|' . $extension[2] . '|' . $extension[3];
}

$query->whereIn(
$query->concatenate(
[
$db->quoteName('type'),
$db->quoteName('element'),
$db->quoteName('folder'),
$db->quoteName('client_id'),
],
'|'
),
$values
);

$db->setQuery($query);
self::$coreExtensionIds = $db->loadColumn();

Expand Down

0 comments on commit 6be3854

Please sign in to comment.