Enable/disable for specific content types

Created on 19 August 2019, over 5 years ago
Updated 19 May 2023, over 1 year ago

The "Clone" tab and functionality is added to every content type. On my site, I only want this feature available on one specific content type. I thought maybe this would be possible by manipulating the permissions of the module, but the user roles that would perform the cloning already have the 'administer nodes' and 'bypass node access' permission, so that method does not work.

It would be good to have a third party setting stored on content types that enables/disables it.

Note that the fix proposed in comment #13 for #2979426: Permissions not respected would not help this issue, since that fix still has 'administer nodes' allow anyone to clone any type.

Feature request
Status

RTBC

Version

1.0

Component

Code

Created by

🇺🇸United States bkosborne New Jersey, USA

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    run-tests.sh fatal error
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    run-tests.sh fatal error
  • 🇳🇱Netherlands nikhileshpaul Eindhoven

    Tested #16 and works fine

  • 🇮🇳India shaktik New Delhi

    I tested #16 and it works fine.

  • First commit to issue fork.
  • Status changed to Needs review 6 months ago
  • 🇺🇸United States markdorison

    #16 was no longer applying cleanly since the inclusion of Make support for groups optional Fixed . We need the latest changes to be in an MR so that tests will run so I created a new branch with the changes from #16 adjusted so that they would apply.

  • 🇺🇸United States jennypanighetti

    After applying MR#30 to 8.x-1.x-dev, I get the following error.

    Error message
    Warning: foreach() argument must be of type array|object, null given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of core/lib/Drupal/Core/Render/Element/Checkboxes.php).
    
    Drupal\Core\Render\Element\Checkboxes::valueCallback(Array, , Object)
    call_user_func_array(Array, Array) (Line: 1285)
    Drupal\Core\Form\FormBuilder->handleInputElement('quick_node_clone_node_setting_form', Array, Object) (Line: 1006)
    Drupal\Core\Form\FormBuilder->doBuildForm('quick_node_clone_node_setting_form', Array, Object) (Line: 1076)
    Drupal\Core\Form\FormBuilder->doBuildForm('quick_node_clone_node_setting_form', Array, Object) (Line: 579)
    Drupal\Core\Form\FormBuilder->processForm('quick_node_clone_node_setting_form', Array, Object) (Line: 325)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 53)
    Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
    
  • Status changed to Needs work 5 months ago
  • 🇨🇦Canada JayDarnell Guelph, Ontario

    MR#30 seems to work great for 8.x-1.19

Production build 0.71.5 2024