Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Creates a reverse entity reference field so that one could find out which fields are being referencing a particular entity.
Similar Module:
https://www.drupal.org/project/entityreference_backreference
Difference:
Uses a computed field rather than a property and is for Drupal 8.
Module:
https://www.drupal.org/sandbox/geraldnda/2847085
Git Clone Command:
git clone --branch 8.x-2.x https://git.drupal.org/sandbox/GeraldNDA/2847085.git reverse_entity_reference
Other Applications:
None
Comment | File | Size | Author |
---|
Comments
Comment #2
PA robot CreditAttribution: PA robot commentedFixed the git clone URL in the issue summary for non-maintainer users.
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
andrew_tspkhHi, @GeraldNDA
Please, check using of \Drupal calls in BackReferenceProcessed class [line:23, line:30].
\Drupal::service() calls should be avoided in classes, use dependency injection instead.
Here is example:
Comment #4
andrew_tspkhAnd remove unnecessary folder .vscode.
Thanks)
Comment #5
deminyThis module is something I'm looking for; however, I noticed following errors when trying to install this sandbox module with Drush:
Comment #6
GeraldNDA CreditAttribution: GeraldNDA commented@justin. I removed .vscode folder and I also moved the addition of the service to the __construct method. However since EntityReferenceFieldItemList doesn't have a container or a create method, I don't think I can inject the dependency the way you are prescribing.
@deminy I created a new branch called 8.x-2.x-dev. If you could, please download that version and try installing it. And repost your error message. I think what is going in on is somehow a field doesn't have a field storage definition. I assume that there always was. So before I band-aid fix it I'd like to do some more investigation and maybe see if it's not this module or something else.
Thanks for all your help so far.
Comment #7
Andre-BHello,
Manual review:
1.) Some code style violations:
2.) short array syntax will be favored in future: https://www.drupal.org/node/2135291
3.) Inline comments would help to understand what's going on. Especially with the nested foreach loops - probably even better to break them up in smaller pieces.
4.) Possible exceeding of maximum length for field names as of https://www.drupal.org/node/2232665
5.) Possible duplication of entries returned:
can be fixed by adding array_unique() in line 57: return array_unique($entity_ids);
Comment #8
klausi@Andre-B: looks like you forgot to change the status. That issues don't look like application blockers, anything else that you found or should this be set to RTBC?
Comment #9
Andre-BComment #10
Andre-B@klausi I wasn't done - as far as I can tell I don't see application blockers. Looks good.
Comment #11
Andre-BPlease ignore the uploaded file. attached and changed the wrong comment. Looks good so far.
Comment #12
GeraldNDA CreditAttribution: GeraldNDA commentedUpdate:
Thanks for the reviews. I recently pushed to the main 8.x-2.x branch fixes to most of the issues mentioned. For next time, I'll probably look towards
and possibly tackling
That particular issue seems pretty difficult to tackle so any input would be appreciated.
Comment #13
deminy@GeraldNDA, I played with commit 1e22a68f4efa6fde0d365950b4382d1364a06145 under branch 8.x-2.x-dev, and noticed same issue when installing the module via Drush:
Looks like some issue with entity type "basic" which I don't use directly in my installation of Drupal 8.
Comment #14
GeraldNDA CreditAttribution: GeraldNDA commented@deminy Try again with the most recent commit and tell me what you get in your database log. I'm starting to think it may be a deleted field that wasn't finalized so it still gets loaded as connected to the entity or something like that. But I modified the code so that it should skip the one causing the issue.
Comment #15
deminy@GeraldNDA I tried to install the module via Drush with latest commit ( 73de02c ) that you pushed out yesterday. The PHP error disappeared, however, the Drush command hang over there forever, which also blocked other HTTP requests to same Drupal site.
At first I thought it might be a memory limit issue; however, same issue happened when I tried to install the module on another server with enough amount of memory. Based on what I checked, it happens inside function reverse_entity_reference_entity_bundle_field_info_alter() or classes/methods called inside that function.
Comment #16
GeraldNDA CreditAttribution: GeraldNDA commented@deminy That's really peculiar and I'll look into the issue. I suggest opening an issue on the project issues page: https://www.drupal.org/node/add/project-issue/reverse_entity_reference . I'm currently trying to working through this issue and also planning to integrate a service and options so you don't have to add fields by default but can still have reverse referencing.
Comment #17
deminy@GeraldNDA I just created a first issue under project "Reverse Entity Reference", as you can see from https://www.drupal.org/node/2860598
Thanks
Comment #18
apadernoThank you for your contribution!
I am going to update your account so you can opt into security advisory coverage now.
These are some recommended readings to help with excellent maintainership:
You can find more contributors chatting on the IRC #drupal-contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
I thank all the dedicated reviewer(s) as well.
Comment #19
apaderno