Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Lightning Core has undeclared dependency on field_ui #327

Closed
wants to merge 1 commit into from

Conversation

danepowell
Copy link
Contributor

@danepowell danepowell commented Apr 5, 2017

If you disable field_ui, you'll get a class not found exception thrown by a class in lightning_core: https://github.com/acquia/lightning/blob/8.x-2.x/modules/lightning_features/lightning_core/src/Form/EntityDisplayModeAddForm.php

At a minimum, this dependency should be declared to avoid a fatal error, which is what this PR does.

However, long-term I think this dependency should be eliminated, since best practice is typically to disable Field UI in production environments.

Note that while field_ui is a declared dependency of the parent Lightning profile, this is no longer adequate protection since sub-profiles can exclude it.

@danepowell
Copy link
Contributor Author

I don't know why the pipelines job failed, but I can't imagine it's related to this change.

@balsama
Copy link
Contributor

balsama commented Apr 10, 2017

Yeah - phantomjs crashed on pipelines - on a known issue. Travis runs that same tests plus upgrade tests. So we're ok there.

This came up before. I thought something had possibly regressed, but I think previously field_ui was an undeclared dependency in panels. See this issue: https://www.drupal.org/node/2664682#comment-11786436

As far as long-term not making it a dependency, this might relate to the ongoing conversation about what dependencies of profile really are. IMO, they're the word dependency is a misnomer. It's more of "this is what should be enabled out of the box". But this PR adds it as a dependency to lightning_core, not the profile. So it would prevent you from uninstalling it.

@phenaproxima can we just make EntityDisplayModeAddForm a little smarter so it doesn't throw an exception without field_ui?

@phenaproxima
Copy link
Collaborator

phenaproxima commented Apr 11, 2017

I have another solution I think I would prefer -- let's just add a \Drupal::moduleHandler()->moduleExists('field_ui') around the logic in lightning_core_entity_type_alter() which uses the offending classes. That way, we can avoid adding a hard dependency.

@camoa
Copy link

camoa commented Apr 14, 2017

Kinda did what @phenaproxima proposed, got it working at once.

I just changed my vendor lightning_core copy, so no patch, but wanted to report it works.

@phenaproxima
Copy link
Collaborator

Closing this PR to implement my suggested fix in another branch (on my own fork).

@balsama
Copy link
Contributor

balsama commented Apr 18, 2017

Fixed in #340

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants