Getting Composer Drafts in PageList
I am trying to list all of the Draft pages in a more friendly interface for a client. I have all of the published pages and their version history, however finding it impossible to get Draft pages which have never been published.
I have a page list, and also used these three calls to get pretty much every page possible:
$list = new \Concrete\Core\Page\PageList(); $list->ignorePermissions(); $list->includeInactivePages(); $list->includeSystemPages(); $list->includeInactive = true;
includeSystemPages seems to work fine, but includeInactivePages does not include any inactive pages (deleted pages or draft pages). You can see I have tried multiple ways to set this but none work.
Does anyone have any ideas?
Because a draft is not approved yet, so it may make sense that it's not being displayed now.
I have 2 blog posts which have changes, but not approved. These show the 'Active' version being version 1 of 2, and version 2 of 2 is the 'Recent' one. By adding that line, those posts both came back as being version 2 of 2, as if it just counted the unapproved pages as being the Active one. This just results in my pending approval pages being shown as published, it is not adding in unpublished Drafts :(
Not sure if you're looking for dollars to spend or not, but it will save you a couple of programming/styling hours I guess haha. If not, you probably end up writing some manual queries instead. If I'm not mistaken, it took me some figuring out to do all this too as not everything is available in the page list class by default.
$list->includeInactivePages(); $list->includeSystemPages(); $list->displayUnapprovedPages(); $list->filterByCollectionTypeHandle('article');
However the versions come back wrong, so I will have to do an extra version check afterwards, but thats better than where I was before.