Quantcast
Channel: Issues for Drupal core
Viewing all 294437 articles
Browse latest View live

[meeting] Migrate Meeting 2022-05-19 1400Z

$
0
0

Hello all, it’s time for the weekly migration subsystem meeting. The meeting will take place in slack in various threads
This meeting:
➤ Is for core migrate maintainers and developers and anybody else in the community with an interest in migrations
➤ Usually happens every Thursday and alternates between 1400 and 2100 UTC.
➤ Is done on the #migration channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Happens in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously!
➤ Has a public agenda anyone can add to. See the parent issue for an idea of the typical agenda.
➤*Transcript will be exported and posted* to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.

Core migration issues

Next video meeting 2022-07-07 2100Z (tentative)

The hope is that most or all of the maintainers will attend. We will try to focus on longer-term goals than in the weekly meeting.

0️⃣ Who is here today? Should we add DrupalCon Global to the annual schedule?

danflanagan8I don’t travel too good, so if DrupalCon Global isn’t in the American Midwest, it’s out of reach for me.
mikelutz (he/him)Hey all.
benjifisherHi!Personally, I am pretty happy with going to DrupalCon NA in person every year. Maybe sometime I will travel to Europe or India for their Cons.But I think there are a lot of people who cannot afford to travel for a conference and really miss the Global events from 2020 and 2021. I think we should make it an annual event.All we need is someone to organize it ...
danflanagan8Oh, the Global Con would always be virtual. I dig that.
alisonAlison here!It was a bummer DrupalCon NA wasn't hybrid, DrupalCon Global is a cool idea!
benjifisherI think it is hard to do hybrid events well. It might be easier to do a separate, virtual (Global) event than to make even one of the existing ones hybrid.Sorry I was not clear about the intent.
danflanagan8I’m not sure an apology is called for :slightly_smiling_face:
quietoneHi. Yes, a regular global virtual event is preferred (increases opportunity for participation and is nicer to the planet) to all in person events.

1️⃣ What should we talk about today? Suggest topics here and I will add threads. I will also check for comments on the issue for today's meeting.

2️⃣ Action items. To be added later.

benjifisherDecide on how to manage the test trait used in #3266491: Add content in tests only when needed.
benjifisherDecide whether to remove permissions, instead of creating temporary permissions, in #2953111: Migrate non-existing permissions to temporary migrate permissions.

3️⃣ Statistics

benjifisherFixed since last week's meeting: 1 (not counting the issue for the meeting).
benjifisherRTBC: 9, 1 of which is Major.
benjifisherNR: 18, including 1 Critical, 2 Major, and 3 that have not been updated in more than two months.
benjifisherGoogle sheet for recording stats: https://docs.google.com/spreadsheets/d/1o0Rjlc1vnnLP5bM5P-SMMyGzqn7258hi...

4️⃣ Comment in this thread if you are looking for ways to help. Give us some idea of what you would like to do: documentation, code review, testing, project management, ...

5️⃣ Previous minutes.

benjifisherIs there anything to follow up? Anything need to be changed in those minutes?
benjifisher

6️⃣ Announcements

danflanagan8I haven’t had much time for contrib lately, but I’ve really been enjoying using @benjifisher’s snippet process plugin and the Migrate Conditions module in a big migration. If you haven’t checked those out, I recommend them!
benjifisherIt looks as though I will be giving a migration session at DrupalCamp NJ next week: https://www.drupalcampnj.org/sessions/build-back-better-migrate-api

The secret title is "recently added process plugins".

I already have a draft of the slides: https://slides.benjifisher.info/migrate-dom-plugins-2021.html#/title-slide. But I wrote that a long time ago. (I think I did not present it on the date mentioned in the title slide.) There are more process plugins I could mention.

benjifisherI have not had a migration project at work for some time, so I have not had a chance to use the new toys!

7️⃣ Migrate non-existing permissions to temporary migrate permissions

benjifisher#2953111: Migrate non-existing permissions to temporary migrate permissions
benjifisherCurrent approach on the issue: define a new config entity type: TemporaryPermission. When migrating, create config entities as needed. The Migrate module provides permissions based on this configuration.
benjifisherThe core committers suggest that we go back to an earlier, simpler approach: just remove any permissions that are not provided by (currently enabled) modules.
benjifisherThey also suggest that, if we keep the current approach, we use state instead of config.
benjifisherLet's discuss pros and cons in this thread. Then decide whether we want to push back or take their recommendation.
benjifisherI do not like the idea of using state instead of config. I like the current approach: it relies on the config dependency system to update user roles when the temporary permissions are removed.
benjifisherI do not like the idea of... just drop these permissions. People can always easily re-enable them if they chose to reinstall the module at a later date.

But we can do better than that without creating temporary permissions.

That comment ignores the fact that many permissions already depend on config. For example, "Edit own Article content".

The earlier approach on the issue was to remove the permissions, but add dependencies so that the code d6_user_role and d7_user_role migrations ran after other migrations that affect permissions.

benjifisherGoing back to the earlier approach puts more of the burden on
  • migration developers: add dependencies to the *_user_role migration as needed
  • site owners: add any permissions that were missed
  • We can make that easier by generating migrate messages and/or log messages listing the permissions that were removed.

benjifisherOther considerations:
  • Some modules are often uninstalled during migrations for performance reasons. For example, search_api. What if these modules provide permissions?
  • The current issue aims to handle the problem for migrations using the UI (migrate_drupal_ui). What about custom migrations and recurring migrations?
mikelutz (he/him)We may just have to go with what the committors ask.
benjifisherIf they insist, of course. If we come up with good reasons, then we might persuade them.
mikelutz (he/him)I tend to agree with them that simpler is better in this case, honestly. Everyone should be going over their permissions with a fine tooth comb after a migration anyway.
alisonI'm not in a position to give technical feedback or suggestions, BUT:

I think migration is hard enough, and I hope the outcome of this will relieve rather than add to DX pain points/complexity/etc.

mikelutz (he/him)Also, if the point is that the configs are storing these temporary permissions forever in case they come back, that kinda defeats the purpose of hardening this system in the first place.
benjifisherIt is not forever.

If you migrate using the UI, then the temporary permissions are removed. For example, it is OK to migrate user roles before content types and you will still have "Edit own Article content".

If something interrupts the migration process, or if you are not using the UI, then you get a warning message on the site status page.

xurizaemonAs a user, I don't think I'd be too concerned about "what if I want to migrate a module's permissions, but have it deactivated".

That feels like a reasonable limitation, while working around to achieve the requirement feels complicated. (For Search API specifically, disabling indexing and retaining the module installation does the job for migrations IMO.)

quietoneIf state or config (not configentity) are used then when the migration via /upgrade is complete more code is needed to remove the roles from the permissions.
quietoneWhen the UI is not used, the 'what should be temporary permissions' will still be assigned to roles and appear on the permissions page.  That seems wrong.
benjifisherI do not understand that last remark. If the migrate module is actually providing permissions, then should they somehow be hidden?
benjifisherMost of my points have been in favor of the current approach (temporary permissions). Here is one against.If the migrate module is providing a temporary permission and another module (after being enabled, or depending on some config) provides the same permission, then the results are hard to predict and potentially confusing. (edited)

8️⃣ Add content in tests only when needed

benjifisher#3266491: Add content in tests only when needed
benjifisherThis issue was RTBC, but now it fails PHPStan tests. Here is my comment from the issue:

This issue needs work. I think the reason is that Drupal's PHPStan rules just got stricter.

The patch in #10 uses CreateTestContentEntitiesTrait in two test classes. That trait defines installEntitySchemas(), which calls installEntitySchema() (singular). Even though the trait's method is never called, PHPStan complains if installEntitySchema() is not defined.

I am not sure what the right fix is. Here are some possible approaches:

  1. Define installEntitySchema() in the test classes, either directly or indirectly. For example, they could extend a base class or use a trait that defines it.
  2. Break up CreateTestContentEntitiesTrait into two (or more) more granular traits, and update every class that uses the trait.
  3. Wrap the definition of installEntitySchemas() in something like if (method_exists(static::class, 'installEntitySchema')) { ... } (untested).
benjifisher@danflanagan8, do you have an opinion on this?
danflanagan8I’ll try to check it out in a bit
benjifisher@mikelutz (he/him), how about you?
benjifisherWhat is the best practice when a trait assumes that some method is available?
benjifisherThe installEntitySchemas() method is used in only two test classes: one for D6 and one for D7.
mikelutz (he/him)A trait really shouldn't depend on a non trait method, I would think. We could get around phpstan by defining it in the classes, but it really seems like the trait is poorly thought out.
danflanagan8I just proposed a couple things on the issue. Not solutions, exactly. More focused on how to manage scope here.

9️⃣ Wrap up

benjifisherThanks for participating! I already updated 2️⃣. Please continue to add comments in the threads. In 1-7 days, we will post a transcript for today's meeting.

[meeting] Migrate Meeting 2022-05-26 2100Z

$
0
0

Hello all, it’s time for the weekly migration subsystem meeting. The meeting will take place in slack in various threads
This meeting:
➤ Is for core migrate maintainers and developers and anybody else in the community with an interest in migrations
➤ Usually happens every Thursday and alternates between 1400 and 2100 UTC.
➤ Is done on the #migration channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Happens in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously!
➤ Has a public agenda anyone can add to. See the parent issue for an idea of the typical agenda.
➤*Transcript will be exported and posted* to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.

Core migration issues

Next video meeting 2022-07-07 2100Z (tentative)

The hope is that most or all of the maintainers will attend. We will try to focus on longer-term goals than in the weekly meeting.

0️⃣ Who is here today?

benjifisherHi! I am on my way to DrupalCamp NJ. The train (Amtrak) gives me a spotty connection but plenty of leg room.
quietoneHi. I do like to travel by train.
mradcliffeHi, matthew here catching up.
alisonhellooooooo

1️⃣ What should we talk about today? Suggest topics here and I will add threads. I will also check for comments on the issue for today’s meeting.

quietone#3198608: trackLastImported YAML key to enable tracking the last import date of a row is undocumented and confusing.
quietonehow to make #3246666: Deprecate migrate_lookup and replace with cleaner process plugin happen

2️⃣ Action items. To be added later.

3️⃣ Statistics

mikelutz (he/him)NR: 21 RTBC:7 Fixed since last meeting: 1
mikelutz (he/him)@benjifisher I can’t help but notice that on this sheet you and I count the >1 month and >2 month columns differently.
mikelutz (he/him)At least I assume, since every other week it looks like there are fewer items older than one month than there are older than two months and that hurts my brain.
mikelutz (he/him)I don’t care particularly, but can we change the column headers to >3mo, 2-3mo, and 1-2mo if that’s how you want them recorded?
benjifisherOK, I will report cumulative numbers from now on, Less pain is good.

4️⃣ Comment in this thread if you are looking for ways to help. Give us some idea of what you would like to do: documentation, code review, testing, project management, ...

5️⃣ Previous minutes.

mikelutz (he/him)#3280040: [meeting] Migrate Meeting 2022-05-19 1400Z

6️⃣ Announcements

benjifisherI am presenting tomorrow at DrupalCamp NJ: https://www.drupalcampnj.org/sessions/build-back-better-migrate-api
Draft of slides: https://slides.benjifisher.info/migrate-dom-plugins-2021.html#/title-slide
danflanagan8I love the dom_str_replace plugin. I’m using it in a current migration to 1) change absolute links into relative links and 2) replace image-style urls with the url of the original image. Similar-ish to the dom_migration_lookup example you have.

7️⃣ trackLastImported YAML key to enable tracking the last import date of a row is undocumented and confusing.

mikelutz (he/him)#3198608: trackLastImported YAML key to enable tracking the last import date of a row is undocumented and confusing.
quietoneJust want to clarify what is to be done with the methods, #3198608: trackLastImported YAML key to enable tracking the last import date of a row is undocumented and confusing.#comment-14534899
mikelutz (he/him)Yeah, they need to be deprecated and removed from the interface
mikelutz (he/him)isTrackLastImported and getTrackLastImported are redundant anyway…
mikelutz (he/him)They will both be deprecated and just return true
mikelutz (he/him)and set doesn’t have to do anything, just be deprecated.
benjifisherIn the Sql id_map, I see
   if ($this->migration->getTrackLastImported()) {
      $fields['last_imported'] = time();
    }

Do we want to call time() a lot or inject Drupal::time() and then call getRequestTime()?

Maybe this is more of a performance hit than the database insertions.

mikelutz (he/him)Yeah, but once per row? still seems minor compared to typical destination processing. I do prefer time over request time, as migrations can run for hours, and I don’t mind having the actual timestamp in there over the time the migration started, or the time the batch started.
benjifisherYes, once per row. That snippet is from saveIdMapping().

8️⃣ Deprecate migrate_lookup and replace with cleaner process plugin

mikelutz (he/him)#3246666: Deprecate migrate_lookup and replace with cleaner process plugin
mikelutz (he/him)I think this could definitely be worked on, but I’m not sure I want to target it before 10.1
mikelutz (he/him)That plugin is so used, I don’t want it deprecated in 9 for removal in 10, even if we could.  I want both available through the D10 lifecycle.
quietoneDefinitely.
quietoneWhat about the existing issues for the current plugin?
mikelutz (he/him)I guess they can be closed as duplicates of this issue, as long as the specific issue is documented here for consideration in the new plugin. Or they can just stay for now and get marked outdated whenever this lands. That might be better, no reason someone can’t try to tackle part of it now while we are waiting on this.
benjifisherThe IS mentions
we return inconsistent stub keys because destination plugins return inconsistant keys

What is the solution?

mikelutz (he/him)It’s already solved. The new stub service is capable of re-keying the destination id values to their key. It can’t do it for this plugin because of BC.  Thats the reason the service class method has that extra parameter that isn’t on the interface that needs to be removed.
benjifisherCan we try test-driven development (TDD)?
  • Start by creating a stub process plugin and copy all the existing tests for migration_lookup.
  • They will all fail because the implementation is just a stub.
  • Change the tests to reflect the desired behavior.
  • Tests will still fail, of course.
  • Add new tests.
  • Make the tests pass.
mikelutz (he/him)It just needs a new plugin so we can send consistent stub keys without breaking BC
benjifisher@joachim made some suggestions. First one:
  • make the default not stubbing, and call the config option create_stub.

I am in favor. :+1:

mikelutz (he/him)Yes and no.  I mean that’s fine, particularly to use the existing test scenarios as a guide to make sure we cover everything, but this is really a start from scratch thing. I moved the bulk of the new clean logic here into the lookup and stub services a while ago. Really the goal for the new plugin is to remove all the extra cruft that’s still in migrate_lookup just for BC purposes. Catching and discarding exceptions, making the stub service NOT return consistent keys, and trying to return different array/scalars based on how many results are returned.
benjifisherFirst we have to bike-shed the name, right?
mikelutz (he/him)That’s really what’s been stopping me the last couple years.
benjifisherI think there is some code that automatically adds dependencies when it finds the migration_lookup plugin. Do we want to keep that?
mikelutz (he/him)Is that in core, or migrate_upgrade?
mikelutz (he/him)I think migrate_upgrade has some special handling which may or may not be needing to be adjusted.
benjifisherI think it is core. I will try to find it.
benjifisherThe key for the service is migrate.lookup. How about naming the plugin migrate_lookup to be consistent?
mikelutz (he/him)seems a little funky to have that in core. particularly with stubbing, you may not want a dependency there.
benjifisher
/**   * Find migration dependencies from migration_lookup and sub_process plugins.
   *
   * @param array $process
   *   A process configuration array.
   *   * @return array
   *   The migration dependencies.
   */  protected function findMigrationDependencies($process) { 

I came across that when working on deprecating getMigrationDependencies() in preparation for deprecating set().

All of these are in the Migration class.

mikelutz (he/him)huh.. That seems well intentioned but wrong.
benjifisherI always carefully add dependencies for each use of migration_lookup. Then I found that ^^ and thought I had been working too hard.
I kind of think that it is good practice (and not all that hard) to keep track of dependencies. But maybe there are cases where derived migrations or ??? make that hard or impossible.
benjifisherhuh.. That seems well intentioned but wrong.I think we are "on the same page".
mikelutz (he/him)I mean I get it. it’s an optional dependency, and I’m not 100% sure it’s even enforced as a optional dependency in the Executable. I suspect its there primarily for the sorter to attempt to run bulk migrations in a sane order.
benjifisher[#2750639]Make the mother migration plugin gather the dependencies from the plugin definition. Make it optional to avoid any headaches.The optional part may have gotten lost.
benjifisherYou are right: optional as in $migration_dependencies['optional'].
joachimSomething I’ve thought about since is whether instead of a config option for stubbing, we should make 2 different plugins - lookup with stubbing, lookup without. Because it’s a pretty huge difference in behaviour.
mikelutz (he/him)Maybe. The stubbing does everything the non-stubbing one does, it just does a little more in certain circumstances. Not sure it warrants separate plugins. But if we get into defaults for stubs or otherwise more complicated stubbing, it might make sense, particularly now that the meat of the lookup part is abstracted away into a service.
joachimI’m thinking for clarity and DX for people writing migrations, mostly. So it’s immediately clear which behaviour you have. Though I have NO idea what you’d call the two to differentiate them!

9️⃣ Wrap up

mikelutz (he/him)Thanks all! See you next week!
benjifisherTime flies! :thankful: @mikelutz (he/him)!
quietone@mikelutz (he/him) Thanks!
benjifisherI think there is a theme in today's meeting: simplify the code and make it easier to maintain.
  • Remove all the special "convenient" cases from migration_lookup.
  • While you are at it, remove the code for automatically adding (optional) dependencies.
  • Get rid of the boolean $trackLastChanges and just log the timestamp all the time.

Forms API drupal_process_states() hidden content is not visible to screen readers

$
0
0

Thanks to @merlinofchaos in #1963124-7: Resolve WCAG2 accessibility errors on main settings page I learned that the #states mechanism uses CSS display:none; to hide content.

Unfortunately, this means that for screen reader users, nothing gets presented to the user. For a keyboard only user this isn't a problem because when they select a checkbox new ones appear, but screen reader users need to either have access to all of the checkboxes or be alerted that there is a change to the page.

I think the best approach is to simply mimic what we did with element-hidden & element-invisible and make a:

.js .js-hide {
 display: none;
}
.js .js-invisible {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  height: 1px;
  width: 1px;
  word-wrap: normal;
}

I think that would address the problem, but it ties into core/misc/states.js

Any thoughts on this would be appreciated.

Improve user experience of the taxonomy/term/X/edit page

$
0
0

Problem/Motivation

Since terms are now fieldable just like nodes, it would be useful to have vertical tabs here to hide the non-essential elements on the form. For example, the pathauto module provides fields for both the node form and the term form, but where the URL alias field can be nicely tucked away on the node form in vertical tabs, there's no similar interface pattern for terms.

Proposed resolution

- Implement vertical tabs to the taxonomy term edit form.

Remaining tasks

- Implement vertical tabs to the taxonomy term edit form.

User interface changes

- Vertical tabs on the term edit page

Before, including contrib tabs:
Before

After, including contrib tabs:
After

API changes

- (?)

Use AccountInterface::getDisplayName() for RSS feeds in Views

$
0
0

I have the realname module installed on my site to display authors by their realname instead of username. But this is not working for the feed I created in views. The XML generated has the username for the creator for each article. For example:
<dc:creator>daviser</dc:creator>

The creator is set in modules/node/views_plugin_row_node_rss.inc
I found that if I change this

'key' => 'dc:creator',
        'value' => $node->name,

to

'key' => 'dc:creator',
        'value' => format_username($node),

then the realname is used for the creator.

<dc:creator>Ellen Davis</dc:creator>

Coding Standards Meeting 2022-06-21 2100 UTC

$
0
0

Hello all, it’s time for the fortnightly coding standards meeting. The meeting will take place in slack in various threads
This meeting:
➤ Is for anyone interested in the Drupal coding standards.
➤ Usually happens every Tuesday and alternates between NNNN and NNNN UTC. The meeting open for 24 hours to allow for all timezones.
➤ Is done on the #coding standards channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Happens in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously!
➤ Has a public agenda anyone can add to. See the parent issue for an idea of the typical agenda.
➤A transcript will be made using drupal-meeting-parser and posted to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.

Standing items

  • Who is here?
  • What should we talk about today? Suggest topics here and I will add threads. I will also check for comments on the issue for today's meeting.
  • Action Items
  • Approve previous minutes
  • Wrap up

Project issues

Core Coding Standards issues
Coding Standards project issue
Coder project issues

Support _defaults key in service.yml files for public, tags and autowire settings

$
0
0

Problem/Motivation

Symfony allows you to specify _defaults key in your services.yml file. This allows you to specify defaults for all of your services. See https://symfony.com/doc/current/service_container.html

In Symfony it often looks like

# config/services.yaml
services:
    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
        public: false       # Allows optimizing the container by removing unused services; this also means
                            # fetching services directly from the container via $container->get() won't work.
                            # The best practice is to be explicit about your dependencies anyway.

    # makes classes in src/ available to be used as services
    # this creates a service per class whose id is the fully-qualified class name
    App\:
        resource: '../src/*'
        exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'

    # ...

Whilst autoconfigure is not relevant yet it would be nice for a module to be able to declare all of its services as public: false (if for example it wants to prevent the service locator pattern - yes this is hard is Drupal because plugin managers and events don't work with them but maybe in the future) and autowire will be supported by #3021803: Document and add tests for service autowiring.

Proposed resolution

Implement this by copying code from YamlFileLoader once #3021803: Document and add tests for service autowiring has landed.

Remaining tasks

User interface changes

None

API changes

@todo

Data model changes

None

Release notes snippet

@todo

Coding Standards Meeting 2022-06-07 2100 UTC

$
0
0

Hello all, it’s time for the fortnightly coding standards meeting. The meeting will take place in slack in various threads
This meeting:
➤ Is for anyone interested in the Drupal coding standards.
➤ Usually happens fortnightly on Tuesday 2100 UTC. The meeting open for 24 hours to allow for all timezones.
➤ Is done on the #coding standards channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Happens in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously!
➤ Has a public agenda anyone can add to. See the parent issue for an idea of the typical agenda.
➤A transcript will be made using drupal-meeting-parser and posted to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.

Standing items

  • Who is here?
  • What should we talk about today? Suggest topics here and I will add threads. I will also check for comments on the issue for today's meeting.
  • Action Items
  • Approve previous minutes
  • Wrap up

Project issues

Core Coding Standards issues
Coding Standards project issue
Coder project issues

0️⃣ Who is here today? Comment in the thread to introduce yourself. We’ll keep the meeting open for 24 hours to allow for all timezones.

quietoneHi!
dwwDerek @ TEN7
Björn Brala (bbrala)Björn, hello
borisson_Joris, hello
longwavehello!

0️⃣.5️⃣ What do you do to relax?

quietoneWalk and/or hangout in the park watching the clouds.
dwwPlay music, walk in nature, do Self-Breema or Breema Bodywork (www.breema.com), listen to music...
Björn Brala (bbrala)Hmm, so many things. Reading is one of them :)
borisson_biking

1️⃣ Do you have suggested topics you are looking to discuss? Post in this thread and we’ll open threads for them as appropriate.

2️⃣ how do we want to organize ourselves and the work? To make progress on core issue and coding standard issues?

quietoneCan we select some core issues to focus on getting committed in the next minor?
quietoneFor coding s standards, maybe pick an issue to discuss each meeting?
dwwPersonally, I'm still unclear on governance stuff for this effort. My impression is that the coding standards queue is paralyzed from lack of ability to make any formal decisions.
dwwI don't know that that's changed. Maybe the point here is to generate some activity such that things start moving, anyway, even if we're not acknowledged as having any authority to make any decisions. :sweat_smile:
quietoneGood reminder about the governance. That is correct, we are the 'unofficial coding standards committee' so need to be aware that we can not make final decisions in the coding standards issue queue.However, I do think that if we can make high quality activity there and that will lead to a response on the governance issue.
quietoneEven aside from that there are oodles of core CS issues to work through. Including one I should have monitored to get into 9.4 beta and missed.
dwwDo you wanna open 5️⃣ for that issue, so we have something concrete to focus on?
dwwThe longer-term CS issue I'd love to make progress on is #1539712: [policy, no patch] Coding standards for breaking function calls, function declarations, and language constructs across lines, just over 10 years and running.
dwwBut, I have no idea how to move that forward in the current circumstances, really.
dwwSo yeah, I'd love to hear more about your thoughts on how we can help these issues that are basically blocked / stuck, if we have no formal authority. I suppose we can try to generate more activity, refine issue summaries, summarize debates, etc, and make it easier for people who do have authority to make decisions.
dwwJust opened 6️⃣ for this so we can discuss that one more specifically.
quietoneAs I understand it the Coding Standards Committee was a sub group of the Technical Working Group, although mostly the same folks. The TWG is now one person, the only person with authority.
quietoneI think the way to make progress is to demonstrate our commitment and quality of work by triaging the issues and doing as much as we can within the confines of not having authority. I can image that after triaging, many issues could wind up postponed waiting for action from the official Coding Standards Committee. (edited)
dwwSounds good. I'm willing to try. :sweat_smile:

3️⃣ How long should the meeting run, 30 minutes or 1 hour?

dwwProbably doesn't matter much. It's not like this channel is bursting with traffic and we need to end the official meeting "on time" to get on with other things...
dwwSo I'd say at least 1 hour for the formal meeting time, but happy to be flexible.
Björn Brala (bbrala)Our timezone challenges might make that hard, and yeah not sure it is that relevant. An hour should be fine.

4️⃣ Who would like an alternate meeting start time to suit other timezones?

dwwThis time works for me, but I'm happy to have other times if they work better for other folks.
Björn Brala (bbrala)I might be in bed already at this time a lot of days, but let's keep it for now. Alignment and focus might be best for now. If we work together on a few issues we might be able to pull the most into a finished state
borisson_I agree with bjorn here, this is a difficult time for me as well, but as long as it's async that doesn't really matter
longwaveyeah it is difficult for me to commit to any regular time really but the 24h format works well as i can usually jump in somewhere

5️⃣ Proposal: Have this ready 9.5 beta #3264947: [Sep 12, 2022] Add missing docblocks for test methods ::setUp() and ::tearDown()

dwwLooks like a reasonable place to start. Now following. Thanks for the link!
borisson_requeued the test
longwavei don't know why Wim moved this forward while there were 3 days left and there were only minor issues :confused:

6️⃣ What can we do to move #1539712: [policy, no patch] Coding standards for breaking function calls, function declarations, and language constructs across lines forward in the absence of any formal governance authority?

dwwIt's mostly blocked on anyone with authority to make a decision. It was basically ready to go 10 years ago. :sweat_smile: Although there are some newer comments with slightly different proposals that could be assessed, incorporated into the summary, etc.
dwwMy sense is that it's already too big and complicated to ever land. Someone (I forget now who) pointed out that adding ~ a dozen new rules for this isn't likely to make anyone happy.
dwwSo ideally there's a way to simplify the hell out of it and make it easier to read, understand, and reason about.
dww(without 3 pages of SHOULD and MUST clauses) :joy:
quietoneI saw a comment that maybe it needs to be split into smaller steps.
dwwPerhaps, yeah. Although 4 issues that each add 5 new rules isn't necessarily much better than 1 adding 20. But at least if we focus on 5 rules for 1 part of it, it might actually happen, instead of discussing it for another decade.
quietoneIn the end, I reckon we will get to a point where it is all tidied up and the IS states clearly that it is postponed on a specific action by CS committee. (edited)
dwwSounds good.
quietoneSo maybe in a few months (since we are all busy) we can demonstrate that we have regular meetings, are establishing a workflow, making progress in the CS issue queue etc and can then again ask for a review of the governance issue to add people to the CS committee.
borisson_I didn't read the entire issue yet, but can we copy some of the language of what the psr coding standards about this say?
longwaveagree that this one needs splitting into smaller steps or it will just remain stalled imo

Fix a comment typo in MigrateSqlSourceTestBase.php

$
0
0

While checking the migrate core module, I noticed that in the core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php file the word "the" is repeated (100:17).

Changing this will have no effect on any code, just a simple typo in a development comment.

HTML correction problem with text_summary in case of <!--break-->

$
0
0

API page: http://api.drupal.org/api/drupal/modules--field--modules--text--text.mod...

Describe the problem you have found:
The text_summary function has an early exit, if a <!--break--> tag will be found in the content. Sadly i discovered a problem if the author of the html body content didn't placed it correctly:

My body <div>is fine<!--break--></div>

This causes an shortened teaser e.g.:
My body <div>is fine
..and break up the div-structure of the surrounding page.

Not only the author of this body can make this mistake, also the ckeditor / wysiwyg didn't care about.

So i have to handle this issue on the theming layer, but i would prefer a central solution in the text.module.

Here is my patch:

Index: text.module
===================================================================
--- text.module (Revision 121)
+++ text.module (Arbeitskopie)
@@ -361,15 +361,19 @@
   }   
 
   // If a valid delimiter has been specified, use it to chop off the summary.
+  $filters = filter_list_format($format);
   if ($delimiter !== FALSE) {
-    return substr($text, 0, $delimiter);
+    $summary =  substr($text, 0, $delimiter);
+    if (isset($filters['filter_htmlcorrector'])) {
+      $summary = _filter_htmlcorrector($summary);
+    }
+    return $summary;
   }   
 
   // We check for the presence of the PHP evaluator filter in the current
   // format. If the body contains PHP code, we do not split it up to prevent
   // parse errors.
   if (isset($format)) {
-    $filters = filter_list_format($format);
     if (isset($filters['php_code']) && $filters['php_code']->status && strpos($text, '<?') !== FALSE) {
       return $text;
     }   

Config importer fails if a module to be installed conflicts with a module to be uninstalled

$
0
0

Problem/Motivation

If during config import one module has to be replaced with another and the one to be installed has a conflict with the other one, then the import will fail.

Steps to reproduce

1. Install Drupal with the mailsystem enabled.
2. Change core.extension.yml, remove mailsystem and add symfony_mailer and symfony_mailer_bc
3. Observe the following error:

TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class Drupal\symfony_mailer_bc\MailManagerReplacement does not have a method "setThemeManager" in call_user_func_array() (line 279 of /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php).
 [warning] Drush command terminated abnormally.

The error is caused simply because symfony_mailer_bc has to be installed only after the mailsystem has been uninstalled.

Proposed resolution

First uninstall modules and then install modules during configuration import.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

The right mark of the secondary menu is too large

$
0
0

It would be nice to halve the right margin of the secondary menu.

The Logo at :

padding-left: 2.25rem;

The secondary menu should have :

padding-right: 2.25rem;

and no right margin.

Adopt friendsoftwig/twigcs for Twig coding standards

$
0
0

Problem/Motivation

We are using PHP_CodeSniffer for PHP coding standards, ESLint for JavaScript and Stylelint for CSS, but we have nothing for Twig templates.

Steps to reproduce

Proposed resolution

Adopt https://github.com/friendsoftwig/twigcs for ensuring Twig templates match coding standards.

Remaining tasks

  • Add TwigCS to composer.json and commit-code-check.sh
  • Configure it to pass without any violations for now
  • Raise child issues to fix individual violations

User interface changes

API changes

Data model changes

Release notes snippet

Add type declaration to Html::escape() and FormattableMarkup::placeholderEscape()

$
0
0

Html::escape() and FormattableMarkup::placeholderEscape() needs a type declaration to prevent it from passing invalid values to htmlspecialchars(). This can only be done in Drupal 10 since it requires union types which are only support in PHP 8.1.

Original report:

Problem/Motivation

I had contrib functional tests failing with

htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated.

This is due to FormattableMarkup replacements being null - those go straight as nulls down to Html::escape() and hence to htmlspecialchars(), where PHP 8.1 complains.

This is not happening in core so no core tests were complaining.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Upgrade path from CKEditor 4's StylesCombo to CKEditor 5's Style

$
0
0

Problem/Motivation

Drupal 8/9 ship with CKEditor 4's StylesCombo plugin/feature: https://ckeditor.com/docs/ckeditor4/latest/features/styles.html

This shipped with the original CKEditor 4 issue: #1890502: WYSIWYG: Add CKEditor module to core. It provides a configuration UI:

When talking to the CKEditor developers:

We didn’t work on a replacement yet. We’re not even sure whether it’s needed and what’d be the use cases.
There’s a very old ticket: https://github.com/ckeditor/ckeditor5/issues/648 where we started some discussion. There’s also https://github.com/ckeditor/ckeditor5/issues/5700. But in general it’s unclear for us what would this feature be for.

What use cases do you see for it?

My response:

Well … how do we provide an automatic upgrade path in Drupal? 🤔

StylesCombo in CKE4 can only be mapped to heading.Heading in CKE5 as long as it’s only touching <h*>— but StylesCombo allowed much more. How do we automatically take any arbitrary StylesCombo configuration and make it work in CKE5?

It’s fine if it maps to multiple plugins but we do need to provide an upgrade path.

To which they responded:

Yeah, from the upgrade path perspective, there’s certainly a clear reason to do something on our side. What was blocking us so far is that we don’t want to create again a feature that duplicates a big part of the headings dropdown functionality. Thus, product-wise, it’s tricky.

Proposed resolution

Wait for https://github.com/ckeditor/ckeditor5/pull/11349 to ship with the April 6 release of CKEditor 5.

It shipped: #19. 👍

Remaining tasks

  • add @ckeditor/ckeditor5-style package
  • basic functionality
  • TEST: unit
  • TEST: kernel: SmartDefaultSettingsTest expectations should be updated
  • TEST: functional JS for plugin settings
  • TEST: functional JS for using the plugin
  • Upgrade path
  • Additional validation constraints to ensure config always is valid
  • TEST: kernel: new test cases in ValidatorsTest:
    Validator test coverage, which conveys just how precise validation is, which is extra important because as described in #46, the CKEditor 5 Style plugin itself does not do any validation:
    1. INVALID: Style plugin with no styles→ when no styles are configured, having the toolbar item enabled is pointless (this is the only one already passing because it's the only one already implemented)
    2. INVALID: Style plugin configured to add class to unsupported tag→ it does not make sense to allow adding a class to a tag that cannot actually be generated!
    3. INVALID: Style plugin configured to add class that is supported by a disabled plugin→ it does not make sense to allow adding specific classes through a Style that can be supported by enabling a disabled plugin (for example "Alignment")
    4. INVALID: Style plugin configured to add class that is supported by an enabled plugin→ it does not make sense to allow adding specific classes through a Style that are already supported by another plugin (for example "Alignment")
    5. INVALID: Style plugin has multiple styles with same label→ without unique labels, it'd have terrible usability and accessibility
    6. INVALID: Style plugin has styles with invalid elements→ not possible to configure this through the UI, but … it is possible if you modify the configuration directly.
    7. VALID: Style plugin has multiple styles with different labels→ the sole example of a sane configuration, and hence the only not resulting in a validation error

User interface changes

New plugin settings form.

API changes

None.

Data model changes

None.

Release notes

The CKEditor 5 successor of CKEditor 4's StylesCombo functionality has been added. This was the last remaining widely adopted functionality of CKEditor 4 that did not yet have an equivalent!


Configuration changes lost after module install

$
0
0

Problem/Motivation

After we install any module, changes in configuration is getting lost and it is reverting to old state (existing in custom module)

Steps to reproduce

1. Install drupal core 8.8.10
2. Install languages and all language related modules like interface translation, etc.
3. Install metatags module.
4. Create a custom module and add metatag.metatag_defaults.node__article.yml in config/install -

langcode: en
status: true
dependencies: {  }
id: node__article
label: 'Content: Article'
tags:
  title: '[node:title] | health test arabic info & tips | [site:name]'
  description: '[node:title] | health info & tips | [site:name] description'

5. Enable the custom module.
6. Now, change configuration of metatag manually from admin page - admin/config/search/metatag/node__article
7. Set interface translation to English.
\Drupal::configFactory()->getEditable('locale.settings')->set('translate_english', 1)->save();
8. Enable any module for example- devel and we find that change made in step 6 is lost and we see the old state which got added from custom module in step 4.

Looks like the issue seems to happen in locale_config_batch_refresh_name function where we call updateConfigTranslations() which checks if locale_is_translatable($langcode), then merges old config with new config changes and eventually remove the new changes.

Uncaught RfcComplianceException thrown when sending email from a site whose name contains a comma

$
0
0

Problem/Motivation

After the upgrade to 9.2.x two of my sites began to WSoD with uncaught exceptions when they send emails:

Symfony\Component\Mime\Exception\RfcComplianceException: Email ""Foo" does not comply with addr-spec of RFC 2822. in Symfony\Component\Mime\Address->__construct() (line 56 of \path\to\drupal\vendor\symfony\mime\Address.php).

These two sites have names that contain commas. I tested the issue on a vanilla install of 9.3.x-dev and gave the site the name "Foo, Bar, and Baz". The above exception was produced by testing the issue with that site. The exception was thrown because Symfony's MIME component attempted to validate the From address for an email up to the first comma, not the entire address.

I backtraced the issue to a commit made two months ago for #84883: Unicode::mimeHeaderEncode() doesn't correctly follow RFC 2047. In comments #202 and #203 of that issue code was added to the patch that explodes multiple From addresses using commas as a delimiter. See the following snippet from core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php lines 87-92:

    $headers = new Headers();
    foreach ($message['headers'] as $name => $value) {
      if (in_array(strtolower($name), self::MAILBOX_LIST_HEADERS, TRUE)) {
        $value = explode(',', $value);
      }
      $headers->addHeader($name, $value);
    }

Unfortunately, it does not account for commas in the name part of addresses and explodes them too. Thus, I assume this issue would occur for any names that include commas, not only site names.

I attempted to write a failing test for this issue - which I will upload - and wasn't successful. I don't know why, but the test passes with the From address being generated correctly. That's despite the fact that this issue is really easy to reproduce with a vanilla D9 install. But this might explain why this issue wasn't caught before now. There is a test for special characters in email From fields, including commas. It could be that the email test is flawed in a way that causes this problem to not be caught.

This issue is major because it is preventing the site from carrying out normal operations that require sending emails. In my case, I discovered it when attempting to send password reset emails.

Steps to reproduce

1. Create a vanilla install of Drupal 9.
2. Set the site name to one that contains commas, e.g. "Foo, Bar, and Baz".
3. Log out (this might not be necessary, but I did it every time I tested).
4. Visit /user/password and attempt to send yourself a password reset email.

Expected behavior:
The front page should load with a message saying that a password reset email has been sent.

Actual behavior:
After submitting the password reset form the site gives you a WSoD with the above uncaught exception.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Configuration language being overwritten during module install

$
0
0

Problem/Motivation

Steps to reproduce

  • Fresh install (in english)
  • Enable the locale and language modules.
  • Add a language (dutch in my case)
  • Make the newly added language standard language
  • Enable a module which provides default config (book module for example)

Note that this bug only occurs if the default language or the fallback language is not English.

Result

In the UI, you will see some English instead of Dutch on various pages that load configuration.

In the database:
- The base config items in the config table now have a langcode element in them, telling Drupal they are in Dutch not English.
- So when you try to load config, the base config thinks it is Dutch (even though the text is English), and the config overrides (which are still in the config database) are not being loaded to translate the English into Dutch.

Expected result

The English configuration is interpreted as english config, not Dutch, and the config translation overrides are used when viewing the site in Dutch.

Related issues

An issue which does a great job of explaining the issue, including a reference to core issue this was introduced. It also provides proposals: #3150540: Configuration langcode is forced to site default language

This issue seems fairly similar to #2468767: English config source strings are saved as custom translations in locale in foreign install .

Also, UI text gets overridden when modules are installed. This issue is about config being mangled; the UI text problem is a separate issue: #2806009: Installing a module causes translations to be overwritten.

Proposed resolution

There was some debugging done; probably the cause is described in #6 / #11 / #14

There was a test-only patch in #5 but it's really for the related UI text issue, not the config text issue.

Remaining tasks

Make a patch, including a test.

User interface changes

Configuration language will not be changed to an inappropriate language.

API changes

None.

Data model changes

None.

Get CKEditor 5 to work in (modal) dialogs

$
0
0

Problem/Motivation

CKEditor 5 uses tooltips named balloons to provide the configurable functionalities integrated with the editorial experience. For instance with adding a link, a sort of popup named balloon appear to let you configure the link.
CKE5 create link

This feature though is added of "canvas" in a div with the class ck-body-wrapper:
CKE5 offcanvas balloons

That result in the tooltip being missdisplayed (not visible at all) in CKEditor 5 within modals. Hence, the functionality not usable at all. This one, and all relying on those tooltips.

This is true for :
- CKEditor 5 used in textarea configured on views since views uses modals #2741187: Allow usage of WYSIWYG in views text area fields
- for people using Layout Paragraphs to build content
- for any textarea field in a form opened in modal mode
- for any other contrib or core module that would use textareas in modal and that I am not currently aware of

Steps to reproduce

You could apply / try patch here for instance, or use the layout paragraph module.

Proposed resolution

The modal is opened with a given z-index. For example in Seven it is z-index: 1260.
I suggest to apply the following CSS to the .ck-body-wrapper class :

position: fixed;
z-index: 1300;

However, with this trick, the input field still do not get the focus, which I don't know how to handle at the moment.
Demonstration as a gif

Add reusable option to inline block creation

$
0
0

Problem/Motivation

We are now able to create inline blocks from the Layout Builder but they are always set to non-reusable. It would be nice to have a checkbox to decide of the block should be reusable or not, similar to functionality in FPP for Drupal 7. This would allow editors to create reusable blocks while editing layouts for individual pieces of content, rather than having to jump to the "Block layout" section.

Proposed resolution

  • Add a "Reusable" checkbox to inline_block plugins in Layout Builder
  • If checked, it'll expose an "Admin title" field for naming the reusable block
  • Once saved, it'll convert the underlying content block entity to reusable, and convert the inline_block plugin on the Section to a block_content plugin
  • Allow editing the content block referenced by block_content plugins, and include a warning that let's editors know that their changes will be reflected globally

Remaining tasks

  • Determine if this is something we should tackle in core
  • Write tests
  • Conduct usability review

User interface changes

  • Adds checkbox and admin title field when editing inline_block in Layout Builder:
    screenshot of adding a reusable inline block
  • Adds content block fields and warning when editing block_content in Layout Builder:
    screenshot of editing a reusable content block

API changes

None.

Data model changes

None.

Release notes snippet

TODO

Viewing all 294437 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>