Issue: page alias access

Concrete CMS 9.1.3

I am having trouble with the Page List block and specifically getting the URL to a page alias. Ok, I thought, so what if I don’t need a pretty URL, just do /?cID=369 if $page->isAlias(). But even if that check passes, $page->getCollectionID() returns the ID of the original page, not the alias.

I got to digging deeper and in the db, everything looks peachy:

select cID, cPointerID from Pages where cID > 366;
| cID | cPointerID |
| 368 |          0 |
| 369 |        368 |

But when I do $page = Page::getByID(368);, I get:

$page->isAlias(): bool(false)
$page->getCollectionID(): int(368)
$page->getOriginalCollectionID(): NULL
$page->getAliasHandle(): NULL

And for $page = Page::getByID(369);, this:

$page->isAlias(): bool(true)
$page->getCollectionID(): int(368)
$page->getOriginalCollectionID(): NULL
$page->getAliasHandle(): string(0) ""

I would expect getCollectionID() to return int(369) and getOriginalCollectionID() to return int(368) for this to make sense. Or is there another way?

Hi @wtflm - I agree I would expect getOriginalCollectionID() to return the integer 368 there - probably worth opening an issue about on Github:

I had actually, in Page alias access · Issue #11215 · concretecms/concretecms · GitHub, after I remembered that was a thing too. Turns out what I really wanted was getCollectionPointerOriginalID().

Nice, glad you could get that working :+1: