Skip to content

Commit 352d1d5

Browse files
committed
Merge branch '6.x' into feature/user-query
2 parents ed4e87d + 5baf4e4 commit 352d1d5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

yii2-adapter/legacy/elements/Entry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ protected function crumbs(): array
13111311

13121312
// If the section’s source is disabled, just show its name w/o a link
13131313
$sourceKey = $section->type === SectionType::Single ? 'singles' : "section:$section->uid";
1314-
if (app(ElementSources::class)->sourceExists(Entry::class, $sourceKey)) {
1314+
if (app(ElementSources::class)->sourceExists(Entry::class, $sourceKey, withDisabled: true)) {
13151315
$sections = Sections::getEditableSections();
13161316

13171317
$requestedSite = Cp::requestedSite();

yii2-adapter/legacy/helpers/ElementHelper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,16 +686,19 @@ public static function rootSourceKey(string $sourceKey): string
686686
* @param class-string<ElementInterface> $elementType The element type class
687687
* @param string $sourceKey The source key/path
688688
* @param string $context The context
689-
*
689+
* @param bool $withDisabled Whether disabled sources should be included
690+
* @param string|null $page The page to fetch sources for
690691
* @return array|null The source definition, or null if it cannot be found
691692
*/
692693
public static function findSource(
693694
string $elementType,
694695
string $sourceKey,
695696
string $context = ElementSources::CONTEXT_INDEX,
697+
bool $withDisabled = false,
698+
?string $page = null,
696699
): ?array {
697700
$path = explode('/', $sourceKey);
698-
$sources = app(ElementSources::class)->getSources($elementType, $context);
701+
$sources = app(ElementSources::class)->getSources($elementType, $context, $withDisabled, $page);
699702
$rootSource = null;
700703

701704
while ($path) {

yii2-adapter/legacy/models/Section.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ public function getPage(): ?string
454454
{
455455
if (!isset($this->page)) {
456456
$sourceKey = $this->type === Section::TYPE_SINGLE ? 'singles' : "section:$this->uid";
457-
$source = ElementHelper::findSource(Entry::class, $sourceKey);
457+
$source = ElementHelper::findSource(Entry::class, $sourceKey, withDisabled: true);
458458
$this->page = $source['page'] ?? false;
459459
}
460460

0 commit comments

Comments
 (0)