FILE: D:\xampp\htdocs\drupal9.5\web\modules\contrib\content_hub_tree\src\Form\MenuContentTreeForm.php
-----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
210 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------

Comments

Harsh panchal created an issue. See original summary.

Harsh panchal’s picture

Category: Task » Bug report
Status: Active » Needs review
StatusFileSize
new2.73 KB

I have fixed this issue and providing a patch.

jatingupta40’s picture

Assigned: Harsh panchal » jatingupta40
Status: Needs review » Active

I will review this patch.

jatingupta40’s picture

+++ b/src/Form/MenuContentTreeForm.php
@@ -104,13 +112,15 @@ class MenuContentTreeForm extends EntityForm {
+    ¶

@@ -123,7 +133,8 @@ class MenuContentTreeForm extends EntityForm {
-      $container->get('content_hub_tree.helper')

The space is remove which is fine but the cursy brace of line 125 should be shifted to line 124.

jatingupta40’s picture

Status: Active » Needs work

I will resolve it and will provide a final patch.

Harsh panchal’s picture

@JatinGupta40 I will check its working fine plz give me an screenshot

jatingupta40’s picture

StatusFileSize
new52.97 KB

I am having this error(image uploaded).
Also, Need to add a parameter comment for configFactory.

+++ b/src/Form/MenuContentTreeForm.php
@@ -21,6 +21,7 @@ use Drupal\content_hub_tree\HelperService;
+use Drupal\Core\Config\ConfigFactory;
jatingupta40’s picture

Issue summary: View changes

@HarshPanchal Also, I have made the changes and created the patch for that, not many changes are there. Can I share the patch, so that you can have a look?

jatingupta40’s picture

Issue summary: View changes
jatingupta40’s picture

Assigned: jatingupta40 » Unassigned
jatingupta40’s picture

Assigned: Unassigned » jatingupta40

Hi, @Harsh panchal
As it has been three days and there is no update on this issue. so, I am assigning it to myself and will provide an updated patch for it.
Thanks

jatingupta40’s picture

Providing an updated patch solving the Dependency Injection related issue.
Please review it.
Thanks

jatingupta40’s picture

Assigned: jatingupta40 » Unassigned
atul_ghate’s picture

Assigned: Unassigned » atul_ghate

Hi,
i will review this patch.

jatingupta40’s picture

Status: Needs work » Needs review
atul_ghate’s picture

Assigned: atul_ghate » Unassigned
Status: Needs review » Reviewed & tested by the community

#12 Patch resloved the above mentioned issue , changing its status to RTBC

oleh.tarasiuk’s picture

oleh.tarasiuk’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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