$ phpcs --standard=Drupalpractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml maxlength/
FILE: C:\Users\SI-001\Downloads\maxlength\src\WidgetSettings.php
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
57 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------
Time: 250ms; Memory: 6MB
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 3295118-18.patch | 5.75 KB | adaucyj |
| #18 | interdiff_5-18.txt | 253 bytes | adaucyj |
| #13 | after-saving-node-maxleanth.png | 131.6 KB | anoopsingh92 |
| #13 | maxleanth-2.png | 40.25 KB | anoopsingh92 |
| #13 | maxleanth.png | 135.28 KB | anoopsingh92 |
Issue fork maxlength-3295118
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
Comment #2
rakhi soni commentedKindly review patch,,
Comment #3
akshaydalvi212 commentedHello @Rakhi Soni,
I will review this patch.
Thanks & regards
Comment #4
akshaydalvi212 commentedHello @Rakhi Soni,
After applying the patch, getting some drupal coding standard errors as follows:
I will update the patch which will eliminate the Drupal coding standard errors for the module.
Thanks & regards.
Comment #5
akshaydalvi212 commentedHello,
Providing the updated patch, kindly review it and provide your feedback.
Thanks & regards.
Comment #6
atul_ghate commentedHi,
i will review this patch
Comment #7
atul_ghate commentedThis patch resolves all the issues mentioned above#5 changing its status to RTBC
Comment #8
hipp2bsquare commentedThank you Rakhi and akshaydalvi212 for your work on this and atul for testing.
After applying this patch to the current dev release, attempting to access a Manage form display page for a content type with fields that utilize the Maxlength widget results in the following error:
Can you please take a look?
Comment #9
anoopsingh92Hi @hipp2bsquare,
I am looking into this. Thanks for info the given the error.
Thanks
Comment #10
anoopsingh92Hello
Your patch has been applied successfully.
Thanks for the patch.
Comment #11
anoopsingh92There is no error So now I am moving it to RTBC.
Thanks
Comment #12
anoopsingh92Comment #13
anoopsingh92Hello @hipp2bsquare,
I have installed this module and configured the settings of Maxlength It is working fine for me I didn't get this error
The website encountered an unexpected error. Please try again later.I have attached the screenshots for more clarification.
Thanks
Comment #14
hipp2bsquare commentedNegative. The patch applies fine but the error still exists.
Steps to reproduce:
Comment #15
hipp2bsquare commentedI'm consistently experiencing this issue when applying this patch to multiple sites running Drupal 9.4.2 Turning this over to CEDewey to confirm.
Comment #16
cedeweyI just tested the patch and unfortunately I am also getting the error
ArgumentCountError: Too few arguments to function Drupal\maxlength\WidgetSettings::__construct()I tested this on the main branch of Drupal 9.5.0-dev
Comment #17
adaucyjI'll work on it.
Comment #18
adaucyjCould someone review it, please?
Comment #19
mauryarahul11Thanks @adaucyj for the patch, After applying it, i got the following phpcs errors in js files. Hence moving it to Needs Work.
lets also include
jsfile exension in phpcs command.Comment #20
abhijith s commentedFixed the remaining issues mentioned in #19 .
Comment #21
abhijith s commentedComment #22
emarinho commentedI'll review it!
Comment #23
adaucyjHi, @mauryarahul11. Thanks for the review. As we can see at issue description, its scope is only implements the dependence injection. Maybe there is already a issue created regarding the code standards in the JS file. To keep this issue purpose and avoid conflicts with others issues, would like to suggest use the patch that only corrects the error for what this task was created. We could also change this issue scope (if there is no other issue related) or create a child issue to solve the phpcs in JS files.
Comment #24
emarinho commentedEverything works properly when applying patch in #18, however I think that the .js phpcs errors should be handled as @adaucyj mentioned before, maybe creating a child issue seems to be better.
Comment #25
mauryarahul11just updated the issue title to accommodate code standards issue in this issue only.
Thanks!
Comment #27
hipp2bsquare commentedThank you everyone for your work on this issue. This patch has been committed. There are certainly coding standards issues with the JS. However work will soon begin on a CKEditor 5-compatible version of Maxlength, which will include a refactoring of the project's JavaScript. However, do feel welcome to open an issue and submit your patch for the JS standards refactoring, so that it can be reviewed and tested by the community.