Account created on 30 April 2013, almost 12 years ago
#

Merge Requests

More

Recent comments

🇳🇿New Zealand quietone

This part of enabling"Generic.CodeAnalysis.UselessOverridingMethod", which is in the Problem/Motivation section.

The scope is correct, it is fixing the instances where an unnecessary override was detected by the sniff. There is no change to phpcs.xml.dist because of remaining overrides, which are not unnecessary, will require discussion, and span the code base.

🇳🇿New Zealand quietone

Adding a parent to help keep track of changes for this conversion.

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Rearrange with general first, Tag reference last, and alphabetical in between

🇳🇿New Zealand quietone

Simply headers. Coding standards meetings 2025-02-25

🇳🇿New Zealand quietone

Updating tags per the issue tag guidelines .

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Updating tags per issue tag guidelines . This is already in the 'menu system' component

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

There are existing issues about improving the permissions for menus. It would help to add those as related and to ensure there are no duplicates.

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

The question about quotes resulted in doing a bit of research. I commented on the MR and updated the IS with the result.

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

Drupal 10 is in maintenance mode with a limited set of allow changes .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

Drupal 10 is in maintenance mode with a limited set of allow changes .

🇳🇿New Zealand quietone

The remaining failures are expected because this issue is only for callbacks. The sibling issue needs to be committed first 📌 Fix 'Drupal.Commenting.DocComment.ShortNotCapital' coding standard except for callbacks Active .

But I wanted to see if these are correct in content and meet the special standard for callbacks.

🇳🇿New Zealand quietone

Since SafeMarkup was replaced by FormattableMarkup I think we can continue with this issue. There is already a child issue here for Kernel tests. Another one is needed for Functional tests.

As I understand #51, the follow up was to manage the number of changes. Since then, a separate issue has been created for Kernel test, which will help manage the scale of the changes. So, I don't think the tag is necessary any more.

🇳🇿New Zealand quietone

I read the test \Drupal\Tests\system\Functional\Render\PlaceholderMessageTest::testMessagePlaceholder to improve the descriptions for the @return descriptions in RenderPlaceholderMessageTestController.php.

Linting has passed, so back to NR.

🇳🇿New Zealand quietone

Did cleanup here and removed the out of scope changes and the '@return void'.

I think what is left is to improve the comments in core/modules/system/tests/modules/render_placeholder_message_test/src/RenderPlaceholderMessageTestController.php, some of which are incomplete sentences.

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

@joseph.olstad, One thing I like about this is the passion you have for improving Drupal. What I don't like is the disparaging comments in #58. Those are not aligned with the Drupal value of "treating each other with dignity and respect". Overall, this issue helped me understand your situation and the upgrade challenges you have to manage.

For reference, the value I referred to is in the Drupal Values & Principles .

🇳🇿New Zealand quietone

Tested again with @returns in

  • includes/common.inc
  • modules/dblog/dblog.module
  • modules/migrate/src/Row.php
  • modules/views/src/Plugin/views/field/MultiItemsFieldHandlerInterface.php

And PHPStan detected all of them with the same error message as in the previous comment.

🇳🇿New Zealand quietone

It is still not clear where this should go. It could be added as a new page in the guide. PHPUnit in Drupal . That would encourage the practice now and, if desired, an issue can be opened in Coding Standards to formally accept the practice.

I read through the issue to create a a bare minimum proposed text for the changes, which follows. What do you think?

Assertion messages

The default assertion message provided by PHPUnit is sufficient for most situations. The page explains when a custom assertion message can be added and the format of the message.

When to add a custom assertion message

  1. When the assertion in inside a loop.
  2. In a custom assertion method in a trait or base test class. A custom assertion method begins with public function assert*();.
  3. In a helper method.

Format of a custom assertion message

%subject% should %verb% %payload%

Definitions

%subject%

The additional context information

%verb%

The action.

%payload%

The value the%subject% should be.

Example

foreach ($expected_steps as $element_id => $step_value) {
  foreach (['s', 'i', 'h', 'd', 'm', 'y'] as $sub_field) {
    $name = $element_id . '[' . $sub_field . ']';
    $expected_step = $step_value[$sub_field] ?? 1;
    $input = $this->xpath("//form//input[@name='$name']");
    $this->assertCount(1, $input, "Duration input $name should appear exactly once.");
    $actual_step = (integer) $input[0]->attributes()->{'step'};
    $this->assertEquals($expected_step, $actual_step, "Duration input $name should have the correct step value.");
  }
}

  where

{subject} == "Duration input $name"
should == 'should' ;)
{verb} == 'have'
{payload} == 'the correct step value'
🇳🇿New Zealand quietone

Tested on 11.x today

I changed the '@return' to '@returns' in \Drupal\views\Plugin\views\field\MultiItemsFieldHandlerInterface::getItems().

That resulted in this PHPStan error

 ------ ------------------------------------------------------------------------------------------------------------------ 
  34     Method Drupal\views\Plugin\views\field\MultiItemsFieldHandlerInterface::getItems() has no return type specified.  
         🪪  missingType.return                                                                                            
 ------ ------------------------------------------------------------------------------------------------------------------ 

So, although not a phpcs rule the @returns should not be creeping back in the code base.

Shall we close this as outdated or make a change to phpcs.xml.dist to add '@returns' to the the list of 'ForbiddenAnnotations'?

🇳🇿New Zealand quietone

Came across this because it is on 11.1.x instead of 11.x

@vidorado, thanks for thinking about what else needs to be done. However, issues to remove a particular deprecation are not required. When the time code to remove deprecated code, we can simply grep the code base.

Closing as works as designed since we have practices in place that will resolve this before Drupal 12.0.0

🇳🇿New Zealand quietone

I too am not sure about setting it true by default. I am keen to find out what others think.

Added change record.

🇳🇿New Zealand quietone

@martijn de wit, thanks for the screen shots. The screen shots should be available to reviewers in the issue summary and with an explanation of what they represent. They should at least indicate if they are before or after the diff was applied. And I do wonder if 14 screen shots are needed.

@developer-rocha, the MR is made against 11.x, so testing should be done there. Your verify the version by following the MR link in the issue summary.

🇳🇿New Zealand quietone

I did forget that one. I left it because the @return is incorrect as well but never made back to change it.

🇳🇿New Zealand quietone

@koustav_mondal, I think for now this needs to focus on splitting this issue into several smaller more manageable issues. To start can you move the changes in 'core/lib' to 📌 Replace http://example.com with https://example.com in core/ib Active . It is not the most exciting work but it does happen that we need to split an issue into smaller, more manageable pieces.

Given that this is changing nearly 200 files, it will likely need to be split further. I can check in on this in a few days.

🇳🇿New Zealand quietone

How to deprecate explains the steps needed to deprecate something as well as the format of the message. It is in the Core change policies guide where other useful things about core development can be found. I didn't realize when I last commented here that this is a novice issue, and in that case, this information should have been in the issue summary. At least, in my opinion.

I edited the change record so that it contains only the necessary data. Anyone wanting to know more can follow the link to this issue. While it was well written we also want to be concise, simply stating what changed and any action needed to be taken. In this case there is no action, so it can be short.

This still needs code in the function to trigger a deprecation message. I have updated the issue summary.

🇳🇿New Zealand quietone

@adwivedi008, research needs to be done on why the tests have lines of code that are not called.

🇳🇿New Zealand quietone

@bramdriesen, thanks for working on the security related pages. I am a bit confused though because all the old pages have been migrated when we have been only migrating what is current and deleting the rest. I now see Drupal 4 and 6 modules in the docs. Will this not confuse other readers as well?

Also, I went through another section.

🇳🇿New Zealand quietone

I asked in Slack, #media, about why the test was specifically testing user #1. Two media maintainers, marcoscano and seanb responded saying that they saw no reason for it. seanb also said that they probably copied the test from somewhere else and then made it work for media.

So, I think it is OK to remove the specific assertions with user #1. Therefor restoring the RTBC.

🇳🇿New Zealand quietone

quietone made their first commit to this issue’s fork.

🇳🇿New Zealand quietone

To answer #23, the Coding Standards committee itself does not have a charter. It is considered part of The Technical Working Group (TWG). The Job of the TWG is given in the TWG Charter, which states, "to ensure that the necessary policies, procedures, and standards exist to address technical concerns affecting the Drupal community". That would cover making a decision about which style of Markdown to use.

And my personal view is that using the GitLab style makes the most sense.

🇳🇿New Zealand quietone

As @borisson_ points out what we have now is a mixture of the two styles and that, in itself, can be confusing. For some, when reading a file with both styles it raises questions, such why multiple spaces here but not there. And worse, which style do I use when editing the file.

I was just scanning core and the block of code in \Drupal\taxonomy\TermViewsData::getViewsData is a mixture of both styles. For me, it is an example of where allowing both styles reduces readability and that this proposal is a benefit.

🇳🇿New Zealand quietone

How will the sniff know that the test is actually testing translations?

I updated the IS with proposed text.

As for removing the Drupal 6/7 outdated material from the standards docs, I think we can discuss that at a meeting.

🇳🇿New Zealand quietone

@borisson_, I agree that the function parameters read better when on one line each.

Made changes per the feedback and since linting has passed, I am setting to NR.

🇳🇿New Zealand quietone

Time to get some feedback on these changes.

🇳🇿New Zealand quietone

Restoring status from #7

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

I reviewed the latest change and they look correct to me. I am always cautious about out of scope changes but there is logic in tidying up the references to Drupal 6/7/8 as part of explaining the new name.

🇳🇿New Zealand quietone

Hi, the Drupal Core issue queue is not the ideal place for support requests. The 'support request' option is there for filing support issues for contributed modules and themes. There are several support options listed on our Support page . This is 'Get Support' at the top of Drupal.org. There is also information about Drupal Slack , at 'Get Support -> Drupal Slack' also at the top of Drupal.org. You may get better replies in one of those places.

🇳🇿New Zealand quietone

In #15, it was suggested to scope issues by drupalCreateUser and drupalCreateNode. The first issue was completed but new violations have come back into the code base. Because of the I'd rather this is done by directory so the sniff can be enabled as fixes are made.

And for some facts, I enabled the sniff and phpcs reported 1,135 violations in 604 files. The longest line reported is 640, in var/www/html/core/lib/Drupal/Component/Utility/Xss.php.

🇳🇿New Zealand quietone

The new text was not wrapped correctly at 80. I fixed that on commit using a PHPStorm plugin that does the wrapping for me.

Committed to 11.x and cherry-pick to 11.1.x

Thanks!

🇳🇿New Zealand quietone

@annmarysruthy, thanks for doing the research on how the example changed. When doing that important work it helps the others working on the issue to add links to the previous issues and/or commits.

Using git I found that the change happened in 🐛 Example recipe isn't functional Active . And skimming that issue it looks like an oversight that this comment was not updated as well.

🇳🇿New Zealand quietone

Committed f75163a and pushed to 11.x, cherry-picked to 11.1.x

Thanks!

🇳🇿New Zealand quietone

Yes, this reads better, thanks. There is just one more small thing, which I commented on in the MR. For background on that see 📌 [Meta] Use Install/Uninstall consistently for turning modules/themes on/off (not Enable) Fixed .

🇳🇿New Zealand quietone

There has been no further discussion here. And @cilefen, has described the next actions here. So, I am closing this.

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies . Also, Drupal 10.4 is in maintenance mode.

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇳🇿New Zealand quietone

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

Production build 0.71.5 2024