Other entities work but without the additional manage display path like on node types

Created on 29 August 2018, over 6 years ago
Updated 10 October 2023, about 1 year ago

I have created few entities and bundles using ECK module https://www.drupal.org/project/eck
but Conditional Field module is displaying "Manage Dependencies" tab only for Content Types not for any other entities.
Basically it only working for node types.

📌 Task
Status

Postponed: needs info

Version

4.0

Component

Code

Created by

🇮🇳India prashant.c Dharamshala

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

Comments & Activities

Not all content is available!

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

  • 🇪🇸Spain rcodina Barcelona

    I updated the patch so it applies to 4.x. Needs extra work and review.

  • 🇪🇸Spain rcodina Barcelona

    Still needs work and review.

  • 🇺🇸United States jeffschuler Boulder, Colorado

    Re-rolled for latest 4.x-dev.
    (A couple line changes no longer necessary because fixed in 🐛 Warning: Undefined variable $entity_type in Drupal\conditional_fields\Form\ConditionalFieldForm->buildTable() (line 297 Fixed (commit).

  • Testing For 46

    Module can not be installed via drush or UI

    PHP Fatal error:  Declaration of Drupal\conditional_fields\Routing\RouteSubscriber::getSubscribedEvents() must be compatible with Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array in /var/www/html/test46/web/modules/contrib/conditional_fields/src/Routing/RouteSubscriber.php on line 77
     [warning] Drush command terminated abnormally.
    
  • 🇺🇸United States jmester13

    Testing for #46 on 10.1.2

    Patch applies successful.

    Working with Comments on a Media type.

    Unable to add conditional to a List (text) and have a conditional List (text) display.

    Error is:

    "Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 139 of core/lib/Drupal/Core/Entity/EntityTypeManager.php)."

    Thanks for your efforts on this!

  • Status changed to Postponed: needs info about 1 year ago
  • 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin

    Since such modules actually work on fields and not on manage entity type level, I actually see no point why this should not work OOTB.

    I have created few entities and bundles using ECK module https://www.drupal.org/project/eck
    but Conditional Field module is displaying "Manage Dependencies" tab only for Content Types not for any other entities.
    Basically it only working for node types.

    This is a wrong assumption. Only because of you don't "see" something in UI, that does not mean, it doesn't exist. Tested latest Conditional Fields with ECK custom types and the misleading aspect of it is that only the manage display tab is missing. But the ECK types are listed under admin/structure/conditional_fields. And setting up works fur supported field types. If some underlying functionality is broken is not tested yet. But I do not see any issues despite of the issues of some field types which are already reported elsewhere and do not belong to this issue.

    Note: The manage display tab is just a nice additional give away. And opinionated from my POV. The introduction could be based on the confusion users had by setting up CF under a different path than the content type. But field form widgets can create issues sometimes, as we all know in the nested ajax field order form. That's why CF works in most cases better than similar modules. An additional tab close to the fields under manage display was a good compromise back then to minimize UI confusion. Added additionally to the existing path under admin/structure/conditional_fields, where you can set up the conditions without field form widgets or manage display tabs coming into mix. I would rather recommend to stop adding tabs under entity type manage display and leave the settings under the admin/structure/conditional_fields path with good documentation on it.

    That reduces maintenance and unclutters the manage display UI and makes the module more flexible out of the box without hunting the white rabbit in adding forms to any possible place in UI where field bundles are involved.

    Before we can go on here we need more confirmation of users that CF does not work with ECK by using it under admin/structure/conditional_fields and making sure that occurring issues really belong to ECK and do NOT appear on same field types under Entity type "Node".

  • 🇳🇿New Zealand jlscott

    The patch #46 is creating a new class Drupal\conditional_fields\Routing\RouteEnhancer which contains the use statement:
    use Symfony\Cmf\Component\Routing\RouteObjectInterface;
    That class has been deprecated, so the use statement needs to be replaced with:
    use Drupal\Core\Routing\RouteObjectInterface;

    In addition, the patch also creates the class Drupal\conditional_fields\Routing\RouteSubscriber, which contains the method getSubscribedEvents(). The method signature needs to be changed to match the signature of the method in RouteSubscriberBase which is being extended:
    public static function getSubscribedEvents(): array

  • 🇳🇿New Zealand jlscott

    Aagh... Missing semicolon from the replacement user statement. Fixed.

  • 🇫🇷France dqd London | N.Y.C | Paris | Hamburg | Berlin

    Again, like described in my long comment before, please post more reports validating that CF would NOT work with other than node types. Because I already confirmed that it works with ECK types out of the box in the comment above. And #42 confirms that too.

    We should not post further patches here before we have not discussed the maybe missing parts this issue should be focused on now. Like for example the managed display admin path on custom entities.

    To not confuse other users I change the title and hide the patches until somebody chimes in to respond to my comments and is willing ot discuss the updated patch direction for this issue.

Production build 0.71.5 2024