Problem/Motivation
When activating/Installing the "Entity Copy with Reference" extension/module (which is available ) after installing the 'entity_copy_reference 101) module, all main drupal menu at "/admin/structure/" such as Content Types (admin/structure/types) and Comment (admin/structure/comment) , and all the others (block/ccontant/display/...,view) are not accessible . Situation returns to normal when when the 'entity copy reference' is 'removed/uninstalled' from the Extend list.
I am using Drupal 10 PHP 8.1.16 on a standard/shared cpanel hosting account.
I was installing the drupal via ZIP extract install method (not via composer method) on the following directory "/public_html//mysubdomain.com/mysubfolder/"
The drupal web is accessible on the following domain "www.mydomain.com/myfolder/" not from "www.mydomain.com"
I have not been performing any 'direct hard coding ' modifications method at all, I've only preform standard drupal install/uninstall composer (via terminal), and install/uninstall via Extend Menu. there are other extensions/plugins which I have installed since the fresh install, and most of them are ok, never shows this kind of error.
--
the error message shown in the drupal "admin/reports/dblog/event/312" is as follows:TypeError: Drupal\entity_copy_reference\EntityCopyReference::isCopyEnabled(): Argument #1 ($node) must be of type Drupal\node\Entity\Node, Drupal\node\Entity\NodeType given, called in /home/commyhos/public_html/mydomain.com/myfolder/modules/contrib/entity_copy_reference/entity_copy_reference.module on line 70 in Drupal\entity_copy_reference\EntityCopyReference->isCopyEnabled() (line 43 of /home/commyhos/public_html/mydomain.com/myfolder/modules/contrib/entity_copy_reference/src/EntityCopyReference.php).
Steps to reproduce
Step 1. Terminal : composer require 'drupal/entity_copy_reference:^1.0'
Step 2. Drupal Menu : INSTALL the extension 'Entity Copy Reference (this part seem to cause error/problem in the main drupal menus (content type/comments /others)
Step 3. try to enter the 'Content Type' or 'Comment' menu (or al menu within the STRUCTURE http://yourdomain.com/admin/structure/ ) ,and it will show a blank page with 'one line sentence' error message ="The website encountered an unexpected error. Please try again later."
I've retried the steps a few times and the problems still exists
- 🇺🇸United States duckydan
I ran into this exact thing.
TypeError: Drupal\entity_copy_reference\EntityCopyReference::isCopyEnabled(): Argument #1 ($node) must be of type Drupal\node\Entity\Node, Drupal\node\Entity\NodeType given, called in /var/www/html/beta.weavercafe/web/modules/contrib/entity_copy_reference/entity_copy_reference.module on line 70 in Drupal\entity_copy_reference\EntityCopyReference->isCopyEnabled() (line 43 of /var/www/html/beta.weavercafe/web/modules/contrib/entity_copy_reference/src/EntityCopyReference.php).
I am on Drupal 10.1.7 and PHP 8.1.12.
I am going to change this to major since it does not work with the current version of Drupal.
- Status changed to Needs review
12 months ago 6:12am 28 December 2023 - 🇮🇳India dineshkumarbollu
created patch for this /entity_copy_reference/src/EntityCopyReference.php line 70 excepting Node,Added condition in patch please review.
- 🇪🇬Egypt rami.sedhom
Patch in comment #4 worked with me, thanks @dineshkumarbollu
How to push this to be released in next version?
- Status changed to Closed: duplicate
7 months ago 4:09pm 20 May 2024 Same issue described in #3347826 🐛 all admin-structure menus(Content Types, Taxo, Menu, Views, etc) are inaccessible after activating entity_copy_reference module Needs review .