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

Section storage parameter converter prevents full-page caching for entities with Layout Builder disabled

$
0
0

Problem/Motivation

The section storage parameter converter in Layout Builder returns NULL for the layout_builder.overrides.ENTITY_TYPE_ID.view route where the associated entity doesn't have Layout Builder enabled (or doesn't allow layout overrides), causing the page to not be cacheable.

Steps to reproduce

Install Layout Builder, but don't enable it for any entity types. Ensure menu local tasks appear on all pages. Navigate to a sample entity and observe that full-page caching is impeded with a max age of 0 seconds from the "Layout" local task's forbidden access result caused by ParamNotConvertedException.

Proposed resolution

  1. Modify OverridesSectionStorage::extractEntityFromRoute() to remove the validation on the extracted entity. (This will cause OverridesSectionStorage::deriveContextsFromRoute() to return the appropriate context values.)
  2. Modify LayoutTempstoreParamConverter::convert() to run context validation before returning the section storage.
  3. Augment LayoutTempstoreParamConverter::convert() to return the entity's default section storage plugin as a fallback. This will cause a section storage type mismatch that can be detected in LayoutBuilderAccessCheck::access().
  4. Augment LayoutBuilderAccessCheck::access() to exit early with a forbidden access result if a section storage type mismatch is detected (cached until the applicable entity display is updated).

Remaining tasks

  1. Observe no failures in existing test cases in Drupal CI (or address failures as needed)
  2. Write tests to cover the changes in this issue
  3. Subsystem maintainer review
  4. Add release notes snippet (should one be required)

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Release notes snippet

To be posted pending additional review.


[META] Go through the .cspell.json to remove spelling errors from the word list and fix them

$
0
0

Problem/Motivation

Follow up #2972224: Add .cspell.json to automate spellchecking in Drupal core, Drupal core now using cspell for code spell checking, but there are loads of real spelling mistakes in the first iteration of the core/.cspell.json file.

Proposed resolution

As title and see the change record https://www.drupal.org/node/3122084 for how to work with cspell.
Split up the typos into manageable scope and open child issues.

Lines containing comments (including docblocks) must wrap as close to 80 characters as possible without going over
-- Drupal API documentation standards (general)

Be aware of potential changes, adjusting line-wrapping where necessary.

  1. Wrapped too early
  2. Or over 80 chars

Remaining tasks

  • Go through words in core/.cspell.json file, identity misspelled ones.
  • Group the misspellings into manageably scoped issues.
  • Create child issues for each logical scope.
  • Needs a follow-up for #3138788 comment-12.1

See the kanban board here: https://contribkanban.com/node-board/a9703fb6-a0bc-4dd9-bbe1-4ba065871276

User interface changes

API changes

Data model changes

Release notes snippet

How do I build a redirect on login function that doesn't halt hook execution

$
0
0

Problem/Motivation

9.2.0 broke the existing and widely used pattern for redirection:

$response = new TrustedRedirectResponse($destination); // or RedirectResponse
$response->send();

It results in a "RuntimeException: Failed to start the session because headers have already been sent". error. If this is issued in a hook_user_login() hook, for instance, nobody can ever log in any more, including user #1 (hence tagging it critical).

Steps to reproduce

Either use your own code or one of the many login redirect modules like Redirect after login.

Proposed resolution

Fixing.

[meeting] Migrate Meeting 2021-06-10

$
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

2021-07-01 - 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? Did you see the annular eclipse a few hours ago?

marvil07o/ I did not know about that eclipse :sweat_smile:
mikelutz (he/him)No, couldn't really see it here.
NesleeHey, didn't see here too
MatroskeenIvan, maintainer of Migrate Scanner module :yum:It was rain here, so no luck. (edited)
benjifisherMy wife woke up at 5:30 AM.  The sun was technically above the horizon, but there are too many hills, houses, trees to see it. :disappointed:
benjifisherI know @mikelutz (he/him) is West of me and would not see it, but maybe some of our European friends had more luck. Too bad about the :cloud: and rain in Ukraine.
benjifisher@Neslee, is this your first time here? What part of the world is home for you?
anmolgoyal74Hi.. I think it is not visible in India
huzookaHi - EU, it was partial (8% coverage)
Arthur Deryckere (KenowaX)Yop ! Didn't see it. =(
Neslee@benjifisher its my second time, and i am from Goa
benjifisherWelcome back! Is there something you would like to talk about?
NesleeYa i have added my comment under point 4
gaurav mahlawatHello :wave:
alisonHi! -- didn't see the eclipse, too early for me :parrotsleep:
quietoneVicki

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.

MatroskeenI have a small announcement - Migrate Scanner got a RC recently  - https://www.drupal.org/project/migrate_scannerManual testing and feedback is welcome :slightly_smiling_face:MatroskeenAlso, I wanted to ask about the following case:I have to migrate multiple nodes into one block. This is 2-steps migration:1) nodes -> paragraphs;2) nodes -> block;In the 2nd step I need to have my nodes in a single row.I ended up writing a custom source plugin, but I’m wondering if there is a better option. (edited)

2️⃣ Action items. To be added later.

3️⃣ Statistics

benjifisherFixed since last week's meeting: 0 (not counting the issue for the meeting).
benjifisherRTBC: 11, 2 of which are Major.
benjifisherNR: 29, including 2 Major and 11 that have not been updated in more than three months.
benjifisherGoogle sheet for recording stats: https://docs.google.com/spreadsheets/d/1o0Rjlc1vnnLP5bM5P-SMMyGzqn7258hi...
benjifisherI guess the core committers are busy with security releases and the upcoming 9.2.0.
Matroskeenlarowlan mentioned this recently in #bugsmash channel:there has been a lot of freezes lately, between security releases and 9.2 beta/rcs(edited)

4️⃣ How can I help? 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, ...

NesleeI started to get into migration tagged issue queue from last week, and will be working on testing/code review
benjifisherAre you set up for testing? There are a few extra steps compared to typical Drupal core issues, at least if you are testing migrate_drupal.
NesleeYes, i believe. If you have anything else extra, that you want me to look into, docs link?
benjifisherThere are lots of issues that need review (as reported in 3️⃣) https://www.drupal.org/project/issues/drupal?status=8&component=migratio...
NesleeYa i had when over this filtered list, planning to start :+1:
benjifisherThere are also issues for Migrate Plus: https://www.drupal.org/project/issues/migrate_plus?status=8
NesleeAh this initiative  is also  working on even contrib modules? didnt knew that
benjifisherTechnically, we are not an initiative. But maybe we should be. If you want to create a page for the migration community initiative, that would be another way to help!

5️⃣ Previous minutes.

benjifisherIs there anything to follow up? Anything need to be changes in those minutes?
benjifisher#3216355: [meeting] Migrate Meeting 2021-06-03

6️⃣ Migrate Scanner release candidate

benjifisherhttps://www.drupal.org/project/migrate_scanner
benjifisher@Matroskeen, can you give a short description to save others the trouble of following the link? Maybe a little copy/paste.
MatroskeenYes, sure.This module provides a recursive directory scanner for migrations files. So you can place migration files into sub-directories like:migrations - foo - foo_bar.yml - foo_foo.yml - bar - baz - bar_baz.yml
MatroskeenAs a bonus, it allows to alter discovered migration files by implementing hook_migrate_scanner_patterns_alter hook.In this way, I was able to get rid of unnecessary migrations when using Migrate Source UI module.Kudos to @benjifisher for the nice feature request and code review.
Arthur Deryckere (KenowaX)I started using it this week. It's really helpful. I was worried migration tags wouldn't be compatible as it's from migrate plus but it works fine.
benjifisher@Matroskeen, where is a good place to provide feedback? Other than this thread?
benjifisher@Arthur Deryckere (KenowaX), how many migrations are you managing?
MatroskeenIssues/feature requests - in the issues queue.Other feedback can be either in this thread or general Slack channel. (edited)
Arthur Deryckere (KenowaX)@benjifisher about 20 in 3 different languages. Making the total 60. And it keeps on growing. We're planning to reduce that number in the futur but used the migrate scanner as a way to keep a structured file system in the mean time.

7️⃣ Add documentation for file source plugins

benjifisher#3189876: Add documentation for file source plugins
benjifisherIt is 2:12 AM for @quietone now, but she asked,What examples, if any, do you think should be in the docs for the file source plugins?
benjifisherWe already got one reply in this channel from @huzooka :I would simply look into the tests and repeat the plugin configs being tested in a human-friedly way :slightly_smiling_face:
huzooka:slightly_smiling_face:
benjifisherI have never used the D6 upload plugins (d6_upload, d6_upload_instance) so I have no suggestions there.
benjifisherI see this in the current patch, for the d6_file source plugin: * Available configuration keys: * - site_path: (optional) The path to the site directory relative to Drupal * root. Defaults to 'sites/default'.That is a good start, but the question is about examples, and I think good examples will help a lot.
benjifisherThis is really confusing. People do not realize what the right directory structure is. When I first started doing migrations, I figured it out by looking at the "file not found" error messages.So I think it is worth adding two full examples.
benjifisherOMG, I did not realize we did this in prepareRow() (D7 version): $path = preg_replace('#' . preg_quote($this->configuration['constants']['source_base_path']) . '#', '', $path, 1);We should make source_base_path a top-level configuration item if we are going to use it like this. But that is an issue for another day.
benjifisherWhat happens if $this->configuration['constants']['source_base_path'] is not set? :thinking_face:
benjifisherIt is kind of crazy. We strip out source_base_path in prepareRow() and then we add it back with the concat plugin in the process phase. :scream:
benjifisherLet's start with an example based on d7_file.yml, but skip the step where we concatenate with the empty string:source: plugin: d7_file scheme: public constants: source_base_path: ''process: uri: plugin: file_copy source: - filepath - uriAll of that inside @code tags. Then explain what the path to the files directory has to be to make this work. And test it.Then we need a second example where source_base_path is not empty ...
alisonGlad this is moving along!  I commented a month ago that the info I want in documentation is included with the patch that's been written so far, so I'm a happy camper.

8️⃣ Proposed new process plugin: service

benjifisherLast week, @mikelutz (he/him) wrote,Also just the difficulties with dependency injection. You either have to store the whole container in the plugin, or break dependency injection.and I asked,I do not understand DI well enough. The container is an object, and storing an object just means storing its handle, right? I do not see the problem with that, unless the plugin gets serialized.
huzookaI will repeat myself - we can use a deriver
benjifisherIf breaking DI means we cannot test it properly, maybe that is a blocker for core but not migrate_plus. It would be pretty easy to extend the callable plugin and use \Drupal::service() to load the requested service. @heddn, would that meet the standards of migrate_plus?
benjifisherIf we use a deriver, then the usage is something likesome_field: plugin: service:pathauto.alias_cleaner method: cleanString source: whateverright?
huzookayepp
benjifisherWouldn't that mean a lot of work during plugin discovery, loading all services? And caching all of them?
huzookaNo,I don't think so (edited)
huzookaBTW if we don't inject services, then we can still test them it (edited)
benjifisherI already admittedI do not understand DI well enough.What is the problem with breaking DI for this pluign?
heddnI don't have concerns with breaking DI. But I'm also not sure why we would need to break it. We get configuration passed into a plugin creation. public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL)
benjifisherRight, so we have the container and the configuration available in the create() method. This might be even easier to implement than I thought.
quietoneOr have a destination pipeline?
benjifisherI do not know what you mean by a destination pipeline. Did you mean to comment on 9️⃣?
benjifisherIt is so easy to implement that it feels like cheating. #3218356: Process plugin: service

9️⃣ Many-to-one migrations

benjifisherQuoting @Matroskeen from 1️⃣:I have to migrate multiple nodes into one block. This is 2-steps migration:1) nodes -> paragraphs;2) nodes -> block;In the 2nd step I need to have my nodes in a single row.I ended up writing a custom source plugin, but I’m wondering if there is a better option.
benjifisherI think that is the only way to do it currently.
benjifisherI think it would be useful to have a destination plugin that merges multi-valued fields instead of skipping them or overwriting them. Would that work for this use case?
MatroskeenHmm… not sure to be honest.I was thinking about the opposite direction - changing the source rows.It can be done by adding option to SourcePluginBaseand convert existing rows into one with items key. (edited)
benjifisherWhen you say "opposite direction", you mean making changes in the source plugin instead of destination plugin, right?I think we agree this is a many-to-one problem, not one-to-many.
benjifisherProbably neither of our suggestions will be added to core, but they might be added to Migrate Plus.
benjifisherCan you give an example of what your source plugin configuration would look like?
MatroskeenThere is no configuration yet. This is how it looks in my custom plugin:protected function initializeIterator() { $single_row = ['items' => iterator_to_array(parent::initializeIterator())]; return new \ArrayIterator($single_row);}
benjifisherHow does that work? Does it simply create a source plugin that always returns a single row?
benjifisherClarification: my previous question meant if we were to modify SourcePluginBase (your suggestion) then what would the YAML look like in a migration?
MatroskeenI didn’t try it yet, but I’m already facing issues related to missing ID property :sweat_smile:Chances are my approach is not gonna work at all
MatroskeenWhen I figure it out, I’ll make a feature request to migrate_plus module.But the idea is the following - create a single row and place original rows as a single row property.
benjifisherThink about my suggestion. If we have a row for each paragraph, and we can figure out which node to attach the paragraph to, then all we need is some way to add items to an existing field.I think a new destination plugin is the way to do that, but maybe there is some other way.
mikelutz (he/him)How are you identifying which block your nodes are going into?
mikelutz (he/him)Or is it literally every node in the migration becomes a paragraph, all of which are added to a single paragraph field in a custom block?
MatroskeenYep, that’s right.Actually, when I have a custom block, I would need one more step - place that block into layout builder of the homepage.My approach with making one row worked, but now I have to think more about @benjifisher’s suggestion. (edited)
MatroskeenTo give more context:This is gonna be a slideshow, where each slide is a node in D7, but paragraph in D8/D9. (edited)

1️⃣0️⃣ Compatibility with Drush 10.4+

benjifisher@marvil07, any recent progress? There was a question in this channel earlier today.
benjifisherRelated: with issues like https://gitlab.com/drupalspoons/migrate_tools/-/issues/92 should we reopen the related issue on d.o, #2701121: New batch started because of not enough reclaimed memory seems to forget which migrations have already run leading to missing migration dependencies ?Maybe this is something where we could encourage new contributors to help with the issue management. What do you think, @heddn?
marvil07@benjifisher No progress over last few weeks on my side, I have been focusing on migrate code reviews :slightly_smiling_face:
benjifisherAre you the one responsible for so many RTBC issues?
radelsonStill curious about this question !  => We're having memory issues during one of our migration and if we end up using BatchMigrateExecutable (this issues #2701121: New batch started because of not enough reclaimed memory seems to forget which migrations have already run leading to missing migration dependencies ), I'd like to contribute our work on it but I'd like to have some pointers on what's the best way to have it merged somewhere now that migrate:import command is not in migrate_tools anymore

1️⃣1️⃣ Wrap up

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

Participants:

marvil07, mikelutz (he/him), Neslee, Matroskeen, benjifisher, anmolgoyal74, huzooka, Arthur Deryckere (KenowaX), gaurav mahlawat, alison, quietone, heddn, radelson

[meeting] Migrate Meeting 2021-06-17

$
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

2021-07-01 - 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.

Agenda items

0️⃣ Who is here today? Is there anything you are still putting off because of the pandemic?

dinarcon:wave: Hi. Does attending in-person conferences count? :sweat_smile: Looking forward to when that is possible again.
Matroskeen:wave: I’m Ivan, maintainer of Migrate Scanner and some other contrib modules.Travelling, events with many people like conferences, concerts, etc.
benjifisher:wave: Benji, one of the maintainers of the migration subsystem. I just got some dental work done yesterday. I have a couple of doctor visits that I should schedule soon.
chx (he/him):wave: I'm chx, I did some work on the migration subsystem very long ago.
quietoneVicki. Nothing I can think of.
mikelutz (he/him)Hey all, I’m late but lurking.
gaurav mahlawatHello :wave:
alisonHi :meow-wave-peek: I don't think so... I'll be going to the movies with my mom soon, I'm expecting to be a little stressed about it but still excited. Oh and I'm getting on a plane in July, not looking forward to that, but the family gathering will be worth it. The only thing left is a concert, I can't wait to go to concerts!...So I guess to your actual question haha: no -- and I feel very, very lucky. (edited)
NesleeHello :wave::skin-tone-2:

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.

dinarconShall we add a status update of the Migrate Tools command integration with Drush 10.4+ as a recurrent topic?
dinarconAnd I would like to talk about how to improve documentation for migration related contrib modules? I have been working on media migrations lately and while modules are present, not much documentation is available.
chx (he/him)Hi. I came up with a new notation and some code to make it work looks like field_topics: "field_topics/*/tid using d7_taxonomy_term:topic"
benjifisherI do not want to add a thread every week for updates. Certainly, when there are updates, Marco should let us know and I will open a thread.Are there other volunteers to help with this?
MatroskeenI’m not sure if a new thread is required, but it would be great to have someone to look at: [#3197324]I know it’s annoying for many people working with migration tests.

2️⃣ Action items. To be added later.

benjifisherTroubleshoot #3096101: Allow migrate_drupal_ui source database to be set in settings.php. @Matroskeen

3️⃣ Statistics

benjifisherFixed since last week's meeting: 3 (not counting the issue for the meeting).benjifisherRTBC: 8, 2 of which are Major.benjifisherNR: 28, including 2 Major and 10 that have not been updated in more than three months.benjifisherGoogle sheet for recording stats: https://docs.google.com/spreadsheets/d/1o0Rjlc1vnnLP5bM5P-SMMyGzqn7258hi...Matroskeenlet me help you and add a new row to the docedit: Added stats for today (edited)benjifisherThanks. I was about to do that when it got to be 5:00. (That is, time to start the meeting: 5 PM ET.) (edited)

4️⃣ How can I help? 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, ...

quietoneI will help anyone who wants to learn about reivews or improve their review skills with a migration issue.

5️⃣ Previous minutes.

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

6️⃣ Regression: multilingual taxonomy term migrations are failing ... (edited) 

benjifisher#3219078: Regression: multilingual taxonomy term migrations are failing if user tries to migrate from Drupal 7.81+ and Entity Translation 7.x-1.1

7️⃣ What new events, if any, should be added? (edited) 

benjifisher#2890012: New event dispatch: a migrated entity is about to be saved
benjifisher#3125174: Send migrate event even if row not saved
benjifisher#3096000: PRE_IMPORT event detect whether an update or not.
benjifisher#3201624: Dispatch a MigrateRowFailEvent when a row fails
benjifisher(stalled?) #2952291: Dispatch the PREPARE_ROW event. Deprecate prepare_row_alter hooks
quietoneI was hoping to get feedback on whether these new events should be added or not. Trying to move this group of issue along.
benjifisherI do most of my custom coding in the process stage. I have not noticed a need for more events.In other words, I do not have an informed opinion on these issues.
quietoneI'm having a hard time seeing the need for 'Send migrate event even if row not saved'

8️⃣ d7_language_content_comment_settings triggers MigrateException if the source bundle is longer than 32 chars: use migration_lookup

benjifisher#3219140: d7_language_content_comment_settings triggers MigrateException if the source bundle is longer than 32 chars: use migration_lookup

9️⃣ Allow migrate_drupal_ui source database to be set in settings.php

benjifisher#3096101: Allow migrate_drupal_ui source database to be set in settings.php
benjifisherCan someone help debug why the form is not submitting?
MatroskeenI can take a look in the upcoming days.From my experience, it usually happens because of failed form validation.
benjifisherthx
quietone@Matroskeen I look forward to learning from you on this one!
MatroskeenDid my homework today: #3096101: Allow migrate_drupal_ui source database to be set in settings.php#comment-14138192 (edited)
benjifisherSo it was a problem with client-side validation?
MatroskeenYep

1️⃣0️⃣ documentation for migration related contrib modules

benjifisherWhat is needed most, a summary page in the docs for Migrate API or improvements to the project pages?
benjifisherDo we already have links to contrib module in the Migrate API docs?
dinarconSome official documentation would be nice. I guess that would fall under https://www.drupal.org/docs/contributed-modules
dinarconAnd there is this page listing some migration related modules from the upgrade guide https://www.drupal.org/docs/upgrading-drupal/drupal-8-migrate-modules
dinarconDocumentation in a README or a blog post linked from the project page would also be useful.
dinarconI am bringing this up because recently I look at Media Migration module. It looks like it does a lot of what I need, but there is not much documentation. But others modules would benefit from improved documentations as well.
benjifisherIf there is already a page in the official docs, then anyone can edit it. If you want to add a new page, then you need one of the guide maintainers (like me) to add it to the navigation menu.
dinarconSomething that would be nice is if modules provided example repos where one could see how they are intended to be configured and used.
benjifisherContrib module READMEs and project pages are different.
benjifisherExample repos is a lot to ask for. Unfortunately, the expectations are pretty low for documentation of contrib modules.
benjifisherWe could use a community initiative to work on that. Maybe even give a few people permission to update project pages and README files for other people's projects. Probably that is too much to ask for.
dinarconOne can only dream :slightly_smiling_face: Examples might not be feasible, but I would still like to find a way to improve documentation.

1️⃣1️⃣ New notation for fields

benjifisher@chx (he/him), I see that you already posted about this in the #contribute channel, but I have not read that thread yet. Can you explain again here (and save meeting members the trouble of following a link)?
chx (he/him)sure thing
chx (he/him)so I have been migrating a real lot of fields and writing out the plugin: sub_process - source - process - plugin - source again and again gets real old real fast
chx (he/him)so I was thinking, you know, we could just use "field_something/*/tid" to abbreviate where * notes we want to iterate over it (note the sub_process at one point was called iterator) and then tid means the field property we are using
chx (he/him)similar notation exists for entity query with field_something.*.foo
quietoneThere is an issue in migrate tools or migrate plus about reusing pipeline snippets. Haven't found it yet. Still looking.
chx (he/him)it's also quite BC friendly because I sincerely doubt anyone ever had a valid source property containing an asterisk
chx (he/him)more, when migrating fields like these, the reason you are not copying them is very likely because they are reference fields which were migrated themselves
chx (he/him)so you have a migration_lookup in the sub process
chx (he/him)so that's how I arrived to field_topics/*/tid using d7_taxonomy_term:field_topic and  once again that string is looking even more BC friendly
chx (he/him)the code required to parse this and translate back to normal notation is minimal
chx (he/him)I have little doubt it is useful I just do not know whether it's useful enough for core
chx (he/him)currently I just use my own migration class which extends the core migration class, very easy
chx (he/him)I could use the alter hook as well but this is easier
benjifisherI found the "pipeline" issue: #3123534: Create a "pipeline" process plugin to re-use YAML config
benjifisherI do not think any of the proposed "pipeline" implementations will handle this.
chx (he/him)that's a different issue, I think
chx (he/him)mine is about reusing a template
chx (he/him)I can write a templating system too if you want -- I always was an ardent follower of "no kill like overkill" :slightly_smiling_face:
benjifisherCould it be implemented as a process plugin with configuration instead of introducing new syntax?
chx (he/him)yes but the savings would be much less
chx (he/him)also, while the code to normalize this is easy, the code to do this from a process plugin is slightly less easy
chx (he/him)you need the process plugin manager, instantiate the sub process plugin with the right configuration
chx (he/him)slightly less easy but surely doable
chx (he/him)but again then you are writing three lines per field instead of one :slightly_smiling_face: still much less than the full blown field reference migration
benjifisherIf it is not introcuding new functionality, just simpler syntax, then I do not think there is a good case for it in core. Every new feature means more maintenance, more work for the poor testbot.
benjifisherThe sub_process plugin is not used all that much in core:
$ ag -ric sub_process core/modules/*/migrations
core/modules/field/migrations/d7_field_instance.yml:1
core/modules/file/migrations/d6_upload.yml:1
core/modules/filter/migrations/d6_filter_format.yml:1
core/modules/filter/migrations/d7_filter_format.yml:1
core/modules/image/migrations/d7_image_styles.yml:1
core/modules/rdf/migrations/d7_rdf_mapping.yml:1
benjifisher@dinarcon, how do you like that string of options for ag? :wink:
chx (he/him)that's truly surprising
chx (he/him)how are we migrating term reference fields without them?
dinarconTIL there is an ag command :sweat_smile: Nice options.
quietoneA point in favor of the new syntax is that may slow down the constant flow of questions about what to put in the pipeline for a field.
chx (he/him)or does core still suppose primary ids do not change?
benjifisherYes, most of the core migrations preserve entity IDs.
quietoneThe term reference, and most reference fields, get their pipeline dynamically in a MigrateField plugin, https://api.drupal.org/api/drupal/core%21modules%21taxonomy%21src%21Plug...…]21TaxonomyTermReference.php/class/TaxonomyTermReference/9.1.x
MatroskeenIf this syntax was available, I would use it for sure. I always find the sub_process plugin syntax a bit hard to write. Really looking forward to seeing it somewhere (core or contrib) (edited)
quietone@mikelutz (he/him), what are your thoughts on this?
benjifisherIf I understand correctly, then a better title for this thread would be "new notation for sub_process". For example,
field_topics/*/tid using d7_taxonomy_term:field_topic
would be equivalent to something like
field_topics:
  plugin: sub_process
  source: <not sure>
  process:
    tid:
      plugin: migration_lookup
      migration: d7_taxonomy_term:field_topic
      source: tid

That is certainly cumbersome.

benjifisher... but if we make it too easy, then no one will need to hire "experts" like us! :wink:
chx (he/him)lol
chx (he/him)`  source: ` is source: field_topic
chx (he/him)sorry it's a  bit confusing example with the field and vocab being called the same
chx (he/him)Untitled 
field_topics:
  plugin: sub_process
  source: field_topic
  process:
    tid:
      plugin: migration_lookup
      migration: d7_taxonomy_term:topic
      source: tid

vs

field_topic/*/tid using d7_taxonomy_term:topic
mikelutz (he/him)I'm not a huge fan of it in core. It doesn't add any new functionality to what migrations can do, and every layer of shorthand we code in is another layer of complexity to maintain. I think it would better live in a contrib migration_plugins_alter hook.
chx (he/him)I can most certainly do that
chx (he/him)I will release a small module doing that in a few weeks
alisonTIL there is an ag command :sweat_smile: Nice options.Me too, cool! (@benjifisher Is it correct that the main advantage over grep is that it's faster, and it excludes files/paths in gitignore and a custom .ignore file, or more than that? (If more than that, I can ask outside this thread, I don't mean to hijack.)Speaking of the thread itself: interesting convo, glad I came in to catch up - I look forward to seeing more later. (edited)
marvil07@chx (he/him) Nice to see you around migrations! :confetti_ball:
marvil07 I was confused at first with the reference to the re-usable pipelines.But now that I think about it, maybe a way to do pre-processing of the whole migrate plugin may be the connection.i.e. to translate asterisk into something else using sub_process plugin, would be similar to preprocess the migration to do replace some tokens with actual process pipelines.
marvil07:+1: on trying to do it on contrib first.
chx (he/him)Do or do not. There is no try :stuck_out_tongue:
benjifisherWhy not hijack the thread?Yes, ag (the "silver searcher" for comic book fans) is an alternative to grep. I think @alison listed the main advantages. Also, it takes 1/2 as long to type as "grep".I think it also skips composer-managed files. So it will search Drupal core if you are in a clone of Drupal core, but not if you are working on a site.A big part of its speed is all the stuff it knows to skip.
alisonThank you @benjifisher!

1️⃣2️⃣ Exception trace cannot be serialized because of closure

benjifisher#3197324: Exception trace cannot be serialized because of closure
MatroskeenIt just needs a review.The root issue seems to be coming from PHPUnit, so we just need to find some suitable way around that. (edited)
quietoneRan into this yesterday working on an issue. And, sorry to say, because of it I stopped working on that issue and did something else.Coming from PhpUnit, kinda fits my experience. This started happening after one of the issues about changing assertions.

1️⃣3️⃣ Wrap up

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

Participants:

dinarcon, Matroskeen, benjifisher, chx (he/him), quietone, mikelutz (he/him), gaurav mahlawat, alison, Neslee, marvil07

Fix Drupal.Array.Array.[ArrayClosingIndentation, ArrayIndentation] coding standard

$
0
0

Part of #2571965: [meta] Fix coding standards in core.

Approach

We are testing coding standards with PHP CodeSniffer, using the Drupal coding standards from the Coder module. We need to do a couple of steps in order to download and configure them so we can run a coding standards check.

Step 1: Add the coding standard to the whitelist

Every coding standard is identified by a "sniff". For example, an imaginary coding standard that would require all llamas to be placed inside a square bracket fence would be called the "Drupal.AnimalControlStructure.BracketedFence sniff". There are dozens of such coding standards, and to make the work easier we have started by only whitelisting the sniffs that pass. For the moment all coding standards that are not yet fixed are simply skipped during the test.

Open the file core/phpcs.xml.dist and add a line for the sniff of this ticket. The sniff name is in the issue title. Make sure your patch will include the addition of this line.

Step 2: Install PHP CodeSniffer and the ruleset from the Coder module

$ composer install
$ ./vendor/bin/phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer

Once you have installed the phpcs package, you can list all the sniffs available to you like this:

$ ./vendor/bin/phpcs --standard=Drupal -e

This will give you a big list of sniffs, and the Drupal-based ones should be present.

Step 3: Prepare the phpcs.xml file

To speed up the testing you should make a copy of the file phpcs.xml.dist (in the core/ folder) and save it as phpcs.xml. This is the configuration file for PHP CodeSniffer.

We only want this phpcs.xml file to specify the sniff we're interested in. So we need to remove all the rule items, and add only our own sniff's rule. Rule items look like this:

<rule ref="Drupal.Classes.UnusedUseStatement"/>

Remove all of them, and add only the sniff from this issue title. This will make sure that our tests run quickly, and are not going to contain any output from unrelated sniffs.

Step 4: Run the test

Now you are ready to run the test! From within the core/ folder, run the following command to launch the test:

$ cd core/
$ ../vendor/bin/phpcs -ps

This takes a couple of minutes. The -p flag shows the progress, so you have a bunch of nice dots to look at while it is running. The -s flag shows the sniffs when displaying results.

Step 5: Fix the failures

When the test is complete it will present you a list of all the files that contain violations of your sniff, and the line numbers where the violations occur. You could fix all of these manually, but thankfully phpcbf can fix many of them. You can call phpcbf like this:

$ ../vendor/bin/phpcbf

This will fix the errors in place. You can then make a diff of the changes using git. You can also re-run the test with phpcs and determine if that fixed all of them.

Fix spelling for words used once, beginning with 't' -> 'z', inclusive

$
0
0

Problem/Motivation

Limit this to one line easy fixes, avoid any possible controversy, or any change that would better fit with other words, such as doing chien and chiens in the same patch.

The list of words beginning with t -> z, inclusive, that are used once in one file and the name of the file.

Proposed resolution

Exclude words covered in #3210125: Fix spelling in core.* yml files
Skip all the word prefixed with 'un'.

Remove the following from dictionary.txt
28 words
-teletubbies
-testdisplay
-testfetch
-testwithleadingslash
-testwithnewline
-testwithslashes
-testwithtrailingslash
-texample
-todos
-trgm
-typemanager
-uicrud
-vendored
-verison
-webuser
-windir
-winnt
-wonkiness
-wontmatter
-workspaceswitcher
-wqkcy
-xampl
-xlen
-xlgp
-xsses
-yml's
-yourbackend
-znor

Remaining tasks

Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet

Allow tokens for url of the Link field

$
0
0

The link text of the link field does allow to use tokens, but the url does not.

A use case example is using the link for a sharing function where the link is

http://twitter.com/share?url=[current-page:url:absolute]&text=[current-page:title]

and the link text "Twitter".

It does not appear logical why I can use tokens for the link text and not for the title. Therefore I marked this as a bug.


Use TrustedRedirectResponse Error on Multilingual Setup

$
0
0

I received the following error while setting up a multilingual website:

Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.

Here is the sequence to create this error:

  • Install new 8.0.1 website using English
  • Enable Language Translation and Language Modules
  • Allow Trusted Hosts: localhost, www.localhost& es.localhost in settings.php
  • Add Spanish language
  • Set Detection & selection > Domain to www for English and es for Spanish & Save Configuration

I've done this several times in beta.

As a side note. On the "Detection & selection" screen, the user is entering "sub-domains" not "Domains" as the screen says. In this example: Example: Specifying "de.example.com" as language domain for German will result in an URL like "http://de.example.com/contact"., de is a sub-domain of example.com/. This screen should likely be changed.

Call to a member function getSetting() on null in Drupal\migrate_drupal\Plugin\migrate\EntityReferenceTranslationDeriver->getDerivativeDefinitions()

$
0
0

Problem/Motivation

I have been developing a site that uses migrate fairly heavily to migrate data from a D6 site to a D8 site. Migration has run just fine on the site until doing an upgrade to 8.5.4 - the migration runs in 8.5.3, but after upgrading to either 8.5.4 or 8.5.5 migration consistently is broken. The symptom, for example when running drush ms is

Error: Call to a member function getSetting() on null in             [error]
Drupal\migrate_drupal\Plugin\migrate\EntityReferenceTranslationDeriver->getDerivativeDefinitions()
(line 101 of
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/modules/migrate_drupal/src/Plugin/migrate/EntityReferenceTranslationDeriver.php)
#0
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101):
Drupal\migrate_drupal\Plugin\migrate\EntityReferenceTranslationDeriver->getDerivativeDefinitions(Array)
#1
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87):
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#2
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/modules/migrate/src/Plugin/MigrationPluginManager.php(256):
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#3
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175):
Drupal\migrate\Plugin\MigrationPluginManager->findDefinitions()
#4
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/modules/migrate/src/Plugin/MigrationPluginManager.php(109):
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#5
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/modules/contrib/migrate_tools/migrate_tools.drush.inc(499):
Drupal\migrate\Plugin\MigrationPluginManager->createInstances(Array)
#6
/home/elections/domains/develections.cruiskeenconsulting.com/public_html/modules/contrib/migrate_tools/migrate_tools.drush.inc(149):
drush_migrate_tools_migration_list('')
#7 phar:///usr/bin/drush/includes/command.inc(422):
drush_migrate_tools_migrate_status()
#8 phar:///usr/bin/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#9 phar:///usr/bin/drush/includes/command.inc(199): drush_command()
#10 phar:///usr/bin/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#11 phar:///usr/bin/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 phar:///usr/bin/drush/includes/startup.inc(462): drush_main()
#13 phar:///usr/bin/drush/includes/startup.inc(369):
drush_run_main(false, '/', 'Phar detected. ...')
#14 phar:///usr/bin/drush/drush(114): drush_startup(Array)
#15 /usr/bin/drush(10): require('phar:///usr/bin...')
#16 {main}.
Error: Call to a member function getSetting() on null in /home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/modules/migrate_drupal/src/Plugin/migrate/EntityReferenceTranslationDeriver.php on line 101 #0 /home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\migrate_drupal\Plugin\migrate\EntityReferenceTranslationDeriver->getDerivativeDefinitions(Array)
#1 /home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#2 /home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/modules/migrate/src/Plugin/MigrationPluginManager.php(256): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#3 /home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(175): Drupal\migrate\Plugin\MigrationPluginManager->findDefinitions()
#4 /home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/modules/migrate/src/Plugin/MigrationPluginManager.php(109): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#5 /home/elections/domains/develections.cruiskeenconsulting.com/public_html/modules/contrib/migrate_tools/migrate_tools.drush.inc(499): Drupal\migrate\Plugin\MigrationPluginManager->createInstances(Array)
#6 /home/elections/domains/develections.cruiskeenconsulting.com/public_html/modules/contrib/migrate_tools/migrate_tools.drush.inc(149): drush_migrate_tools_migration_list('')
#7 phar:///usr/bin/drush/includes/command.inc(422): drush_migrate_tools_migrate_status()
#8 phar:///usr/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#9 phar:///usr/bin/drush/includes/command.inc(199): drush_command()
#10 phar:///usr/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#11 phar:///usr/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#12 phar:///usr/bin/drush/includes/startup.inc(462): drush_main()
#13 phar:///usr/bin/drush/includes/startup.inc(369): drush_run_main(false, '/', 'Phar detected. ...')
#14 phar:///usr/bin/drush/drush(114): drush_startup(Array)
#15 /usr/bin/drush(10): require('phar:///usr/bin...')
#16 {main}
Error: Call to a member function getSetting() on null in Drupal\migrate_drupal\Plugin\migrate\EntityReferenceTranslationDeriver->getDerivativeDefinitions() (line 101 of /home/elections/domains/develections.cruiskeenconsulting.com/public_html/core/modules/migrate_drupal/src/Plugin/migrate/EntityReferenceTranslationDeriver.php).
Drush command terminated abnormally due to an unrecoverable error.   [error]

I'm not quite certain how to proceed at this point, this sounds quite a lot like it may be related to https://www.drupal.org/project/drupal/issues/2912348 - but that appears to be fixed. If there is any help possible here I'd appreciate it.

Steps to reproduce

TBD

Proposed resolution

Add a check for NULL before using the returned array. The docs for \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldDefinitions() doesn't state that NULL can be returned.

Remaining tasks

Manual testing - There are 3 reports of successful manual testing of the patch in #3, See #8, #10, #12, and #26.
Write a test - To do this a field needs to be created that does not have a definition. How to do that?
Review
Commit

Allow the ChangedItem to skip updating

$
0
0

Problem/Motivation

Especially for migrate it would be really useful to be able to copy the old changed time, for example from a note.

After #2428795: Translatable entity 'changed' timestamps are not working at all we have a solution for new entities, but we still need a solution for existing entities e.g. currently you can't resave an entity with changes without updating the changed timestamp.

Proposed resolution

Allow to skip the automatic updating.

Remaining tasks

User interface changes

API changes

Call to undefined method Swift_Mime_Headers_UnstructuredHeader::getAddresses()

$
0
0

All letters (including from /admin/config/swiftmailer/test) not sent with error:

The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Swift_Mime_Headers_UnstructuredHeader::getAddresses() in Drupal\swiftmailer\Utility\Conversion::swiftmailer_filter_message() (line 413 of modules/contrib/swiftmailer/src/Utility/Conversion.php).
Drupal\swiftmailer\Utility\Conversion::swiftmailer_filter_message(Object) (Line: 337)
Drupal\swiftmailer\Plugin\Mail\SwiftMailer->mail(Array) (Line: 50)
Drupal\mailsystem\Adapter->mail(Array) (Line: 311)
Drupal\Core\Mail\MailManager->doMail('swiftmailer', 'test', 'info@sday-lom.ru', 'ru', Array, NULL, 1) (Line: 180)
Drupal\Core\Mail\MailManager->Drupal\Core\Mail\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 181)
Drupal\Core\Mail\MailManager->mail('swiftmailer', 'test', 'info@sday-lom.ru', 'ru', Array, NULL, 1) (Line: 70)
Drupal\mailsystem\MailsystemManager->mail('swiftmailer', 'test', 'info@sday-lom.ru', 'ru') (Line: 57)
Drupal\swiftmailer\Form\TestForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 113)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 593)
Drupal\Core\Form\FormBuilder->processForm('swiftmailer_test_form', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 716)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I guess issue is related to Unicode::mimeHeaderEncode() doesn't correctly follow RFC 2047

If $site_mail is multibyte string like Сдай-лом.рф and from address info@sday-lom.ru
$mailbox->getBodyAsString() in

    if ($site_mail) {
      $mailbox = new MailboxHeader('From', new Address($site_mail, $site_config->get('name') ?: ''));
      $headers['From'] = $mailbox->getBodyAsString();
    }

produces:

=?utf-8?Q?=D0=A1=D0=B4=D0=B0=D0=B9-=D0=BB=D0=BE=D0=BC?=
=?utf-8?Q?=2E=D1=80=D1=84?=

The workaround is patch #3 from https://www.drupal.org/project/swiftmailer/issues/3167898
But letter's From became =?utf-8?Q?=D0=A1=D0=B4=D0=B0=D0=B9-=D0=BB=D0=BE=D0=BC?=.рф <info@sday-lom.ru>

So I guess in $headers['From'] = $mailbox->getBodyAsString(); is something wrong.

Dropbutton is broken on small screen when text is split to multiple lines

$
0
0

In/admin/content, the operation button is broken a little.
Although it may be a priority issue of column width per language.

screenshot

It is not a big problem.
Please consider improvement if necessary.

Thank you.

Extend site information page to generate a manifest.json file

$
0
0

Problem/Motivation

New browser features enable better website integration to users' systems. While working on the progressive web app module I came across a W3C draft for a manifest file. This file is used on mobile devices to allow website authors some control over the way the shortcut and initialization screen looks like.

Proposed resolution

  • Add new form fields and reorganize the site information form.
  • Add a <link rel="manifest" href="…/manifest.json"> tag in the head and a way to generate that file.
  • Generation of a manifest.json file containing at least:
    {
      "lang": "en",
      "dir": "ltr",
      "name": "Very good Drupal Website™",
      "short_name": "Drupal Website™",
      "icons": [{
            "src": "my/default/theme/logo.png",
            "sizes": "144x144"
          }],
      "start_url": "/",
      "display": "browser",
      "orientation": "portrait",
      "theme_color": "#ffffff",
      "background_color": "#ffffff"
    }
    
  • We need to add a <meta name="theme-color"> tag for branding color to compliment the values set inside manifest.json

User interface changes

Site information form changes. New fields:

  • short_name (textfield)
  • start_url (textfield) Could be different from the site homepage.
  • display (select list/radio)
  • orientation (select list/radio)
  • theme_color (probably expose that to themes)
  • background_color (probably expose that to themes)

API changes


Probably some ways for theme to declare/alter informations in the manifest file.

More details: Web app manifests usher new wave of progressive apps to your homescreen.

ExtensionMimeTypeGuesser breaks other mime_type_guesser services

$
0
0

Problem/Motivation

The file.mime_type.guesser employs the service collector pattern to collection all services tagged as mime_type_guesser and the calls each of the guessers until one of them returns a guess. In doing so it accounts for the documented behavior of mime type guessers, as MimeTypeGuesserInterface::guess() documents the return value as:

string|null The mime type or NULL, if none could be guessed

However, the default (and only) mime type guesser in core (ExtensionMimeTypeGuesser) does not follow this behavior and itself returns a default mime type (application/octet-stream) if the extension of the file is not a known one. Thus, any mime type guesser that would otherwise come afterwards is ignored.

The concrete use case is to employ Symfony's FileBinaryMimeTypeGuesser to determine the file's mime type by introspecting the file itself. The service collector pattern suggests that this should be easily possible, but it is not.

Proposed resolution

No longer return a default value from ExtensionMimeTypeGuesser::guess(). Note that because this is a behavioral change, this is targeted for 9.1, even though it is a bug report. (This assessment was not coordinated with release managers and, thus, may be invalid in either direction.)

The default value could either be returned by the service collector itself, if none of the guessers returned anything, or we could add a FallbackMimeTypeGuesser that always returns the default and has a very low priority allowing others to intervene before the fallback, but after ExtensionMimeTypeGuesser.


Allow edit Media items from Media Library modal dialog in CKEditor

$
0
0

Problem/Motivation

At now there are no ways to edit media, that was inserted into content, using Media Library CKEditor widget. So, if user, for example, want to change name of media item, or replace image to other - he have only long way via searching this media item in library on separate page manually, and edit it.

Steps to reproduce

1. Enable Media Library module, and in CKEditor add Media Library button.
2. In node edit form upload and insert some document file (eg "Exomple one.pdf") in CKEditor via "Add Media from Library" button.
3. See, that file name is bad, then try to find way for edit this media to change name of this media - In "Edit media" modal window you will see only align and other widget settings, but not fields of current media.

Proposed resolution

Allow Media items to be edited from modal dialog in CKEditor.

Remaining tasks

Finish patch, discuss scope.

User interface changes

Add link to media edit page.

API changes

None.

Data model changes

None.

Use entity route providers for all content entity types

$
0
0

Problem/Motivation

Except for aggregator_feed, node and user, all content entity types are still declaring their routes manually instead of utilizing the default route provider we have in core now.

Proposed resolution

Use a route provider for all core content entity types, specifically:

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Remove fields that do nothing from the "RSS publishing" settings form

$
0
0

Problem/Motivation

The "RSS publishing" settings form allowed users to change basic RSS feed behaviours on Drupal prior to version 8. Drupal 8/9 now uses a view to provide the front page /rss.xml feed link. This view does not use the RSS form settings, which is confusing for users.

Proposed resolution

Remove the feed description and number of items settings from admin/config/services/rss-publishing form, as neither of these actually have any effect anywhere.

The feed content setting may still be used by Views, this is more complicated to unwind and will be removed in #2601030: Views RSS view mode settings are completely broken.

Remaining tasks

None

User interface changes

The feed description and number of items settings are removed.

API changes

None

Original report by @cafuego

Feature: Add utility classes to Olivero to be used by site-builders

$
0
0

Use case

Site builders frequently want to create specific looks and feels within components they create. This can be done through Views, or contributed modules such as

Implementation

My thought is that we should add granular utility CSS classes similar to Tailwind. Adding styling for full components (such as a tabs component, or card component) has several downsides:

  • Styling closely tied to markup, which the theme cannot control.
  • Harder to maintain. We’d need to set up a visual regression system to do this properly.

Granular utility classes (eg: pt-6 for padding-top: 6 units, or bg-primary-50 for background-color: var(--color--primary-50);) can decouple the styling from Olivero’s markup. In addition it’s easier to maintain.

Note the CSS classes are similar (or duplicate) the classes within TailwindCSS, this does not add an additional dependency to the theme. The CSS classes will be manually maintained (as opposed to generated through a NPM script).

File size and theme settings

The implementation will add approximately 208kb uncompressed and about 23kb compressed. Since these classes will only be used by Drupal site-builders, my thought is that we can disable them by default, and the site-builder can enable them on the Olivero theme settings page.

Right to Left

The classes would utilize CSS logical properties. So, pl-1 would output padding-line-start: var(--sp1). PostCSS would them compile this to

[dir="ltr"] .pl-1 {
  padding-left: 1.125rem;
}
[dir="rtl"] .pl-1 {
  padding-right: 1.125rem;
}

Example CSS classes

  • Margin and Padding:
    • Padding left one unit : pl-1
    • Margin left and margin right one unit: mx-1
    • Padding-top five unit: pt-5
    • Padding top two units at medium breakpoint: md:pt-2
  • Borders
    • md:bl-3 - at medium breakpoint 3px solid border-left
    • border-highlight-60 Border color var(--color``--``highlight-60)
  • Colors
    • text-highlight-60 Sets the color CSS property to var(--color-highlight-60)
  • Backgrounds
    • lg:bg-black-20 sets background-color property to var(--color-black-20) at large breakpoint.
  • Typography
    • font-sans sets font-family property
    • text-sm sets font-size to var(--font-size``--``sm)
    • font-bold sets font-weight: 700
    • leading:2 sets line-height to 2 units

PHPdoc parameter mistype for QueryInterface::condition()

$
0
0

The PHPDoc input parameter for \Drupal\Core\Entity\Query\QueryInterface::condition() is currently:

@param string|\Drupal\Core\Condition\ConditionInterface $field

However this is an incorrect type, it should be:

@param string|\Drupal\Core\Entity\Query\ConditionInterface

This gets reported by PHPstan version 0.12.58 for the following snippet:

    $query = \Drupal::entityQuery('user');
    $or_condition = $query->orConditionGroup();
    $or_condition->condition('name', 'something%', 'LIKE');
    $or_condition->condition('mail', 'something%', 'LIKE');
    $query->condition($or_condition);

Resulting in PHPStan violation:

Parameter #1 $field of method Drupal\Core\Entity\Query\QueryInterface::condition() expects Drupal\Core\Condition\ConditionInterface|string, Drupal\Core\Entity\Query\ConditionInterface given.  
Viewing all 294331 articles
Browse latest View live


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