Problem/Motivation

See #3057545: ResourceTypeRepository wrongly assumes that all entity reference fields have the setting "target_type" for more detailed information.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

hchonov created an issue. See original summary.

hchonov’s picture

StatusFileSize
new1.36 KB
hchonov’s picture

StatusFileSize
new1.46 KB
kfritsche’s picture

StatusFileSize
new1.46 KB
new822 bytes

The method was renamed in https://www.drupal.org/project/drupal/issues/3057545#comment-13187968

Updated the patch for this change.

larowlan’s picture

Issue tags: +Needs tests

Given this is a static method, we should be able to test this with a unit test

Code looks good

kim.pepper’s picture

Issue tags: +#pnx-sprint
jurgenhaas’s picture

@kfritsche I have applied the latest patch to a Drupal 9.1.10 installation but I'm still getting lots of warnings like these when flushing cache:

 [warning] The "inventory" at "node:" references the ":zone" entity type that does not exist. Please take action. ResourceTypeRepository.php:449

inventory is a base field we created in a module for various entity types, e.g. nodes, and we refer to many different other entity types and bundles from it. This is working fine in the UI and storage, but since we enabled jsonapi as well, we're getting these warnings. From the issue above I was hoping this should be fixed by the patch, but it isn't. Any hint what else could be causing this?

bradjones1’s picture

Title: Incompatibility with jsonapi relatable resource search » [PP-1] Implement EntityReferenceItemInterface
Parent issue: » #3057545: ResourceTypeRepository wrongly assumes that all entity reference fields have the setting "target_type"
acbramley’s picture

The blocker for this has had some movement, would be great to get some reviews on the new test coverage :)

bbrala’s picture

Title: [PP-1] Implement EntityReferenceItemInterface » Implement EntityReferenceItemInterface
wim leers’s picture

🥳

jibran’s picture

#5 is still pending.

jibran’s picture

Version: 8.x-1.x-dev » 3.x-dev
jibran’s picture

Title: Implement EntityReferenceItemInterface » Implement DERItem::getReferenceableBundles
Status: Needs work » Needs review
StatusFileSize
new1.16 KB
new1.16 KB

Re-roll #4.

RE #5: the core issue also didn't not add tests for ::getReferenceableBundles() in #3057545: ResourceTypeRepository wrongly assumes that all entity reference fields have the setting "target_type". All the test added in that issue is for deprecation. Also unit test is going to only check that for a given mock object we have some array structure that is already being tested in DER Kernel tests so what exactly trying to test then? I'd say we should add functional tests that can help close #3027430: Dynamic Entity Reference normalization support.

HEAD is failing on 11.x atm after field UI changes. I'm working on fixing it. So ignore the test fails for now but it needs functional test and mentioned above.

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

This looks good to go to me

heddn’s picture

Upgraded to 10.2.0 today and got bit by this. Can we land this and tag a new release?

jibran’s picture

There are some other fails as well. Please see https://github.com/jibran/dynamic_entity_reference/pull/9. Feel free to make it green. I'm trying to find some time but no luck.

jibran’s picture

I think we can fix this and create a follow-up to fix the field settings form for DER.

heddn’s picture

Status: Reviewed & tested by the community » Needs work

I had some time to work on this today. I didn't solve it, but I did figure out where the fault lies. If you manually install DER module on 10.2 and install the inline_form_errors module, you'll see that the issue is with the new field wizard process added in 10.2.

DynamicEntityReferenceItem::storageSettingsFormValidate is triggered and we can't save the field form.

heddn’s picture

Status: Needs work » Needs review
StatusFileSize
new11.03 KB

Let's see how much this fixes. I hope I got all the fixes pulled in from the referenced PR.

heddn’s picture

Hmm, can we enable gitlab integration? It looks like we are being gently nudged to move that direction as I can't run the test bot w/ 10.2 any more.

bradjones1’s picture

@heddn it's enabled by default now... You may need to include a .gitlab-ci.yml file, but there are instructions on doing so.

It does not however work with patches so you will need to re-roll this into an MR.

jibran’s picture

There is already a PR for it. https://git.drupalcode.org/project/dynamic_entity_reference/-/merge_requ.... It is not merged as it is not passing yet.

acbramley’s picture

Status: Needs review » Needs work

@jibran that MR has a lot of changes that are out of scope for getting tests passing, and seem to overlap with #3350347: Declaration of DynamicEntityReferenceItemNormalizer::normalize() must be compatible and/or #3354499: DynamicEntityReferenceItemNormalizer broken on D10 as well.

It would be great to know the list of priorities to getting DER 10.1 compatible and perhaps constrain the gitlab CI MR to just adding the pipeline and getting tests green?

NW because #20 isn't applying

jibran’s picture

I'm happy to commit #14 as is and fix the remaining fails in follow-up issue(s).

jibran’s picture

  • jibran committed a19ca12e on 3.x
    Issue #3057556 by jibran, hchonov, kfritsche, heddn: Implement DERItem::...

  • jibran committed 795bf66f on 4.x
    Issue #3057556 by jibran, hchonov, kfritsche, heddn: Implement DERItem::...
jibran’s picture

Status: Needs work » Fixed

Committed and pushed #14. Thanks!

  • jibran committed a19ca12e on 3377096-der-fix-gitlab
    Issue #3057556 by jibran, hchonov, kfritsche, heddn: Implement DERItem::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.