$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml organigrams/
Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9000 (through xdebug.client_host/xdebug.client_port) :-(

FILE: C:\Users\SI-001\Downloads\organigrams\css\orgchart-layout.css
-----------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
57 | ERROR | [x] CSS colours must be defined in lowercase; expected #cccccc but found #CCCCCC
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------

FILE: C:\Users\SI-001\Downloads\organigrams\organigrams.api.php
------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------
27 | ERROR | Doc comment for parameter $object does not match actual variable name $term
------------------------------------------------------------------------------------------

FILE: C:\Users\SI-001\Downloads\organigrams\organigrams.install
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

FILE: C:\Users\SI-001\Downloads\organigrams\src\TaxonomyTermTree.php
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
155 | ERROR | Doc comment for parameter $fields does not match actual variable name $positions
------------------------------------------------------------------------------------------------

Time: 646ms; Memory: 12MB

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Rakhi Soni created an issue. See original summary.

rakhi soni’s picture

Assigned: rakhi soni » Unassigned
Status: Active » Needs review
StatusFileSize
new1.52 KB

Kindly review patch,,

urvashi_vora’s picture

Assigned: Unassigned » urvashi_vora

Hi @Rakhi,

I will review your patch.

Thanks

urvashi_vora’s picture

StatusFileSize
new56.7 KB

Hey @Rakhi,

I reviewed your patch. It applied cleanly.

Thanks for the patch.

urvashi_vora’s picture

Status: Needs review » Needs work

But,

Still there are certain issues, so moving this to "Needs work".

urvasi@urvasi-Inspiron-15-3552:/var/www/html/contribution/d8_cont/web/modules/contrib$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig organigrams-3301295/

FILE: ...b/modules/contrib/organigrams-3301295/src/Form/OrganigramsImportD7Form.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 79 | WARNING | \Drupal calls should be avoided in classes, use dependency
    |         | injection instead
--------------------------------------------------------------------------------


FILE: ...odules/contrib/organigrams-3301295/src/Form/OrganigramsImportItemsForm.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 150 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
--------------------------------------------------------------------------------


FILE: ...n/d8_cont/web/modules/contrib/organigrams-3301295/src/TaxonomyTermTree.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 133 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 186 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 214 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 223 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
--------------------------------------------------------------------------------

Time: 1.32 secs; Memory: 10MB

urvasi@urvasi-Inspiron-15-3552:/var/www/html/contribution/d8_cont/web/modules/contrib$ 

urvashi_vora’s picture

I am working on them.

urvashi_vora’s picture

Assigned: urvashi_vora » Unassigned
Status: Needs work » Needs review
StatusFileSize
new7.2 KB

Hi,

I worked on them. Providing a patch, please review.

Thanks

patrickscheffer’s picture

Status: Needs review » Needs work

Thank you for your work! I applied your patch on the dev branch in a clean Drupal 9 environment and ran into the following issues:

1. Go to /admin/structure/taxonomy
2. Click on "Add organigram".
3. The following error shows: ArgumentCountError: Too few arguments to function Drupal\organigrams\TaxonomyTermTree::__construct(), 2 passed in /drupal9_data/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262 and exactly 3 expected in Drupal\organigrams\TaxonomyTermTree->__construct() (line 52 of modules/contrib/organigrams/src/TaxonomyTermTree.php).

This can easily be fixed by adding @module_handler as argument to organigrams.services.yml.

Then, the next issue arose:

1. After fixing the missing argument, go to /admin/structure/taxonomy/add/organigram
2. Click on "Import Drupal 7 organigram".
3. The following error shows: Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "entity.query". Did you mean one of these: "entity.query.config", "entity.query.sql", "pgsql.entity.query.sql", "entity.query.null", "entity.query.keyvalue"? in Drupal\Component\DependencyInjection\Container->get() (line 156 of core/lib/Drupal/Component/DependencyInjection/Container.php).

I'm not sure what to do with this one.

mauryarahul11’s picture

Status: Needs work » Needs review
StatusFileSize
new8.52 KB

After applying the patch #7, i got the following phpcs warnings-

FILE: /organigrams/src/TaxonomyTermTree.php
-------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------
 199 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 227 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------

So, I have fixed the above warnings along with @PatrickScheffer's first points after reviewing module in D8 and created a new patch.

and @PatrickScheffer, about your 2nd concern, it is because entity.query got deprecated in D9, see this - entity.query service deprecated in favor of EntityStorageInterface::getQuery()

So, attached patch fixes the phpcs warnings and fatal error of ArgumentCountError: Too few arguments to function Drupal\organigrams\TaxonomyTermTree and You have requested a non-existent service "entity.query"

mauryarahul11’s picture

StatusFileSize
new7.47 KB

here is the updated patch -

juancec’s picture

Status: Needs review » Reviewed & tested by the community

Hi, I reviewed patch #10 and all the PHPCS issues have been fixed. Moving it to RTBC, Good job =)

  • PatrickScheffer committed 1debea1 on 8.x-2.x
    Issue #3301295 by urvashi_vora, mauryarahul11, Rakhi Soni: Drupal Coding...
patrickscheffer’s picture

Status: Reviewed & tested by the community » Needs review

Thank you all for your contributions! I have applied patch #10 and also added access checks to the entity queries because that gave some errors as well. Can someone do a final test on the 8.x-2.x branch before I create a new release?

juancec’s picture

Status: Needs review » Reviewed & tested by the community

Hi Patrick, I've tested the 8.x-2.x branch and the issues related to acces to the entity queries have been fixed. Hence I move it to RTBC.

patrickscheffer’s picture

Status: Reviewed & tested by the community » Fixed

Thanks to you all! I released version 8.x-2.3.

patrickscheffer’s picture

Status: Fixed » Closed (fixed)