This module creates a bridge between other modules or themes in integrating external-referencing SVG icons defined in sprite sheets into Drupal.
This module provides a visual UI for end users to be able to select icons provided by extensions. This module provides no icons by itself.
The focus of this extension and how it differs from other icon modules available is that it provides improved developer experience when using external-referencing SVG icons technique specifically, while not compromising on the user interface as well. I have used a variation of this code on projects for custom themes I built, allowing selection of category icons and such for clients, while keeping an easy maintainable icon system in the theme via a build system.
Project link
https://www.drupal.org/project/ex_icons
Git instructions
git clone --branch 8.x-1.x https://git.drupalcode.org/project/ex_icons.git
PAReview checklist
https://pareview.sh/pareview/https-git.drupal.org-project-ex_icons
Comments
Comment #2
avpadernoComment #3
ankush_03Removing errors on page reported by pareview.
Comment #4
ankush_03Thanks for your contribution !
Fix below issue reported by pareview.
Review of the 8.x-1.x branch (commit f54420f):
Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
DrupalPractice has found some issues with your code, but could be false positives.
FILE: .../pareview_temp/tests/modules/ex_icons_test/ex_icons_test.routing.yml
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
7 | WARNING | Open page callback found, please add a comment before the
| | line why there is no access restriction
--------------------------------------------------------------------------
Time: 2.55 secs; Memory: 4Mb
This automated report was generated with PAReview.sh, your friendly project application review script.
FILE: ...000000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/README.md
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
142 | WARNING | Line exceeds 80 characters; contains 96 characters
--------------------------------------------------------------------------
FILE: .../site1101/web/vendor/drupal/pareviewsh/pareview_temp/ex_icons.module
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
70 | ERROR | [x] Equals sign not aligned with surrounding assignments;
| | expected 1 space but found 2 spaces
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
FILE: ...pareviewsh/pareview_temp/src/Plugin/Discovery/SvgSymbolDiscovery.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
89 | WARNING | Only string literals should be passed to t() where
| | possible
--------------------------------------------------------------------------
FILE: ...areview_temp/src/Plugin/Field/FieldFormatter/ExIconLinkFormatter.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
187 | ERROR | [x] Equals sign not aligned with surrounding assignments;
| | expected 1 space but found 2 spaces
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
FILE: ...sh/pareview_temp/src/Plugin/Field/FieldWidget/ExIconSelectWidget.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
59 | ERROR | [x] Equals sign not aligned with surrounding assignments;
| | expected 1 space but found 2 spaces
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
FILE: ...0/site1101/web/vendor/drupal/pareviewsh/pareview_temp/src/ExIcon.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
19 | WARNING | Only string literals should be passed to t() where
| | possible
--------------------------------------------------------------------------
Time: 3.79 secs; Memory: 6Mb
Comment #5
wongjn commentedI believe this is a false positive due to it being found in a test module.
This is due to a referenced URL.
These errors are due to a bug in the version of drupal/coder that PAReview uses: #2872220: False positive for equal sign alignment if only two variables are with = sign aligned
I believe these code segments are tolerable due to the fact the code sections follow Drupal core code:
SvgSymbolDiscovery.php→\Drupal\Core\Plugin\Discovery\YamlDiscoveryExIcon.php→\Drupal\breakpoint\Breakpoint, \Drupal\config_translation\ConfigNamesMapperComment #6
ankush_03Comment #7
avpadernoWongjn already replied in a comment.
Comment #8
wongjn commentedComment #9
wongjn commentedComment #10
shaktikComment #11
wongjn commentedPlease see my previous comment where I address the PHP_CodeSniffer issues:
Comment #12
avpadernoI reviewed the code and I didn't find any security issues. I am going to approve this application.
Comment #13
avpadernoThank you for your contribution! I am going to update your account.
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 reviewers as well.
Comment #14
avpadernoAs for opting into security coverage for the project you used for this application, keep in mind you need to wait 10 days after the project has been created.
When the field description will not show New projects must wait 10 days before opting into security advisory coverage. Please take this time to review writing secure code and best practices. the field can be changed.