Remove Unpublished Node from node order form

Created on 1 July 2023, over 1 year ago
Updated 5 September 2024, 3 months ago

Problem/Motivation

When we have a lot of nodes in any content type, Manage order form will be too long even if the node is not published. Can we exclude unpublished nodes from Manage order form?

Thank you

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India pankajlogical Jaipur

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @pankajlogical
  • 🇮🇳India pankajlogical Jaipur

    Applied a patch to fix the problem

  • Status changed to Needs review over 1 year ago
  • 🇨🇦Canada geoanders Nova Scotia 🍁

    Thanks for this. Definitely a good idea. I will review and test when I get a moment.

  • 🇨🇦Canada geoanders Nova Scotia 🍁
  • Issue was unassigned.
  • 🇨🇦Canada geoanders Nova Scotia 🍁

    @pankajlogical,

    I think we should make this a configuration item, as some might want both options.

  • Status changed to Needs work over 1 year ago
  • 🇨🇦Canada geoanders Nova Scotia 🍁
  • First commit to issue fork.
  • @bharath-kondeti opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India bharath-kondeti Hyderabad

    Addressed #5 and updated the changes. Please review https://git.drupalcode.org/project/node_weight/-/merge_requests/3

  • 🇮🇳India pankajlogical Jaipur

    Yes, @geoanders that would be great if made this a configuration item. But I am sure unpublished node doesn't need weight as they will not show on the website.

    Thank you @bharath-kondeti updated changes as per @geoanders suggestion.

  • 🇨🇦Canada geoanders Nova Scotia 🍁

    @pankajlogical

    In most typical use cases, unpublished probably doesn't need it, but would like to leave it configurable as someone might require a different use case.

  • Status changed to Fixed over 1 year ago
  • 🇨🇦Canada geoanders Nova Scotia 🍁
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Status changed to Fixed 4 months ago
  • 🇮🇳India Tirupati_Singh

    Hi @geoanders, I've reviewed and tested the new feature Include Unpublished Nodes implemented in the module for including/excluding unpublished nodes from Manage Order form for changing the node weight. After the implementation of the new feature, getting below errors while visiting /admin/structure/types/manage/{content_type}/order page.

    The website encountered an unexpected error. Try again later.
    
    TypeError: Drupal\Core\Entity\EntityStorageBase::loadMultiple(): Argument #1 ($ids) must be of type ?array, Drupal\Core\Entity\Query\Sql\Query given, called in /app/web/modules/contrib/node_weight/src/Form/NodeOrderForm.php on line 130 in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 269 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).

    Also on /admin/structure/node-weight module configuration page the Include Unpublished Nodes checkbox value is not being updated after clicking on the checkbox. The checkbox for this field is always rendered as checked/enabled even if you have unchecked and saved the configuration. I've attached before and after screenshots and video clips for all the issues encountered after the new feature implementation.

    I've fixed the issue and created a patch for the issue fixes as only maintainers can reopen the Closed (Fixed) issue. Please review the changes.

    Thanks

  • 🇮🇳India sourav_paul Kolkata

    @geoanders please review it, As it is causing an error to this: https://www.drupal.org/project/node_weight/issues/3448536 Only allows ordering up to 201 nodes Needs review

Production build 0.71.5 2024