Need to implement publish status on page admin/tmgmt/sources/content
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | filter-publish-status-3093849-11.patch | 4.17 KB | dishabhadra |
| #11 | menu_link_content_status_filter.png | 759.18 KB | dishabhadra |
| #8 | filter-publish-status-3093849-8.patch | 3.83 KB | javjaff |
| #5 | filter-publish-status-3093849-5.patch | 1.69 KB | casper09 |
| #2 | filter-publish-status-3093849-1.patch | 1.71 KB | casper09 |
Comments
Comment #2
casper09 commentedComment #3
casper09 commentedComment #4
berdirThis isn't just about nodes, its' used for any entity type, so we need to make sure that has a 'published' entity key.
Also, indendation is wrong here, should be two spaces less.
the options need to use $this->t() so they can be translated.
maybe do something like
if (isset(..)) {
$query->condition('status', $_GET['publish_status']);
}
Also here, make sure that indentation is correct, like the lines around.
Also, this will require test.
Comment #5
casper09 commented1) indentation - fixed
2) added $this->t() for options
3) indentation - fixed, not using your suggestion, because we must get all values without filter publish
Comment #6
javjaff commentedHi guys.
Greate jobs. Your patch is what I needed ;)
Today I tested your patch on an existing site and on fresh Drupal 8 installation (test site), both with TMGMT 8.12.
1. Test site with fresh installation.
I have few nodes on test site and I unpublished some of them.
I filter by unpublished, then unpublished nodes are displayed only - ok.
I have two content types: Page with revisions and Article without revisions - I assumed that maybe revisions were the problems.
2. Working online website.
I have revisions for nodes on that website.
er by unpublished, some published nodes are displayed - failure.
Comment #7
javjaff commentedHi. As I wrote, I had some problems with filtering content by publish status from the patch #5.
In my case, the problems were related with revisions unfortunately.
Except that publish filter didn't work properly in my case (described above), by the revisions there were some other issues with range/limit of the entities on the list (only few displayed per page; results page with pager) - I had that problem without publish status filter also.
I made few changes and created a new patch (for module version 8.x-1.12), please make a review.
Comment #8
javjaff commentedSorry, my mistake. There's something wrong in my patch 7 (failed to apply).
I generated patch once again.
Comment #10
gebiss commentedYep, the no 5 patch worked exactly as javjaff said. It wouldn't filter correctly.
I tested patch no 8 on TMGMT 8.x-1.14 on Drupal 9.4.5 and it worked for me. The content is filtered correctly on Published and Unpublished filter.
Thanks javjaff
Comment #11
dishabhadra commentedI tested patch #8 on Drupal 10.1.8 and it applied successfully.
For node and taxonomy terms there is a status field so it is filtered correctly on the published and unpublished filters.
But for Menu Link content or for other entities that don't have a status field they get the error.
So I fixed that issue by checking if the field definition has a status field then showing the status filter.
For Menu added the Enabled/Disabled filter.
Comment #12
dishabhadra commentedComment #14
mkalkbrennerThe patch should use EntityPublishedInterface nowadays