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

Wrap field-type settings in a fieldset

$
0
0

Problem/Motivation

This is a follow-up to #1953568: Make the bundle settings for entity reference fields more visible..

When configuring a field (such as /admin/structure/types/manage/article/fields/node.article.field_tags) there are several form elements used by all field types (Label, Help text, Required checkbox). Some field types, such as Entity reference and Link, have additional settings. We would like to make these additional settings, when present, easier to identify.

Proposed resolution

Whenever a field type adds settings to the configuration form, wrap those settings in a fieldset.

Standardize the fieldset label.

Remaining tasks

  • Add screenshots to the issue summary.
  • Decide whether the wrapper element should be added by the field-type plugin or by the parent form.
  • Decide on the standard label: something like "FIELD_TYPE settings" or "FIELD_TYPE options".

User interface changes

This will change the appearance of the field configuration form.

API changes

Whichever implementation we use, the documentation of the form elements returned by the field-type plugin will have to be updated.

Data model changes

None


media_library filter giving Access denied

$
0
0

Hi All,

I have been experimenting with using the media module, specifically the library. I have created a content type and have a media field. All works fine. If I set the form display for the field to "Media Library" all is good. I can create new content, in that content I can add media. However if I go to insert new media into the content and try to filter the media I then get "Access denied You are not authorized to access this page."

If I go to content then media it works fine.

What are the steps required to reproduce the bug?

  1. Add a media field to a content type
  2. Create new content
  3. Add some media
  4. Now try adding media, but us

e the filter

What behavior were you expecting?

  • Was expecting the media library to filter images

What happened instead?

  • Got "Access denied You are not authorized to access this page."

Did I miss something? Is this a bug?

Make exceptions consistent across configuration storage classes

$
0
0

Problem/Motivation

Minor inconsistency in exceptions thrown by configuration storage methods when they are inapplicable.

From \Drupal\Core\Config\InstallStorage:

  /**
   * Overrides Drupal\Core\Config\FileStorage::delete().
   *
   * @throws \Drupal\Core\Config\StorageException
   */
  public function delete($name) {
    throw new StorageException('Delete operation is not allowed.');
  }

From \Drupal\Core\Config\ReadOnlyStorage:

  /**
   * {@inheritdoc}
   */
  public function delete($name) {
    throw new \BadMethodCallException(__METHOD__ . ' is not allowed on a ReadOnlyStorage');
  }

Proposed resolution

Decide which form to use and update accordingly.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Determine whether ComposerProjectTemplatesTest is testing the internet, and if it is, avoid that

$
0
0

Problem/Motivation

Numerous test failures occurred across multiple branches today, mostly with fails like:

#slow.Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest
✗	
Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest
exception: [Other] Line 0 of sites/default/files/simpletest/phpunit-1.xml:
PHPunit Test failed to complete; Error: PHPUnit 8.5.2 by Sebastian Bergmann and contributors.

Testing Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest
.E.                                                                 3 / 3 (100%)

Time: 9.58 minutes, Memory: 14.50 MB

There was 1 error:

1) Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest::testTemplateCreateProject with data set "recommended-project" ('drupal/recommended-project', 'composer/Template/RecommendedProject', '/web')
Symfony\Component\Process\Exception\ProcessTimedOutException: The process "COMPOSER_CORE_VERSION=9.0.x-dev composer create-project drupal/recommended-project testproject 9.0.x-dev -s dev -vv --repository /tmp/build_workspace_0cb74fdd1a5642e0cdf9b32245d4a3a15qTmwc/test_repository/packages.json" exceeded the timeout of 300 seconds.

/var/www/html/vendor/symfony/process/Process.php:1253
/var/www/html/vendor/symfony/process/Process.php:417
/var/www/html/vendor/symfony/process/Process.php:238
/var/www/html/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php:326
/var/www/html/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php:131
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:691
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:597
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:597
/var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:621
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:200
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:159

ERRORS!
Tests: 3, Assertions: 32, Errors: 1.

Since it mentions a 5-minute (!) timeout, I wondered if the spate of fails was related to an infrastructural issue (on or outside of our internal infra). @Mixologic looked into it and said:

but as to why that test is slow is beyond me. It should be all using local path repos and be very quick.

looks like its inside of they symfony process as the timeout:

Symfony\Component\Process\Exception\ProcessTimedOutException

It could just be that aws suffered some instability around when those were processed.

yeah, Im concerned that the timeouts would happen though. Those tests are /should be not using the internet at all.

Proposed resolution

Determine whether ComposerProjectTemplatesTest relies on an external network connection, and if it does, determine whether we can fix it to not do that.

Remaining tasks

TBD

User interface changes

N/A

API changes

TBD

Data model changes

N/A

Release notes snippet

TBD

Can't get entity translation migration working in D8

$
0
0

I see from issue queue that it's been implemented but for some reason I don't see the migrations coming over in my system. Could somebody help? How could I explain this? Could I create sql file for testing?

This is my module list:

lando drush pm-list 
 --------------------- ----------------------------------------------------------- ---------- --------- 
  Package               Name                                                        Status     Version  
 --------------------- ----------------------------------------------------------- ---------- --------- 
  Core                  Actions (action)                                            Disabled   8.6.10   
  Core                  Aggregator (aggregator)                                     Disabled   8.6.10   
  Core                  Automated Cron (automated_cron)                             Disabled   8.6.10   
  Core                  Ban (ban)                                                   Disabled   8.6.10   
  Web services          HTTP Basic Authentication (basic_auth)                      Disabled   8.6.10   
  Core                  BigPipe (big_pipe)                                          Disabled   8.6.10   
  Core                  Block (block)                                               Enabled    8.6.10   
  Core                  Custom Block (block_content)                                Disabled   8.6.10   
  Core (Experimental)   Place Blocks (block_place)                                  Disabled   8.6.10   
  Core                  Book (book)                                                 Disabled   8.6.10   
  Core                  Breakpoint (breakpoint)                                     Enabled    8.6.10   
  Core                  CKEditor (ckeditor)                                         Disabled   8.6.10   
  Core                  Color (color)                                               Disabled   8.6.10   
  Core                  Comment (comment)                                           Enabled    8.6.10   
  Core                  Configuration Manager (config)                              Disabled   8.6.10   
  Multilingual          Configuration Translation (config_translation)              Disabled   8.6.10   
  Core                  Contact (contact)                                           Disabled   8.6.10   
  Core                  Content Moderation (content_moderation)                     Disabled   8.6.10   
  Multilingual          Content Translation (content_translation)                   Enabled    8.6.10   
  Core                  Contextual Links (contextual)                               Disabled   8.6.10   
  Field types           Datetime (datetime)                                         Disabled   8.6.10   
  Field types           Datetime Range (datetime_range)                             Disabled   8.6.10   
  Core                  Database Logging (dblog)                                    Enabled    8.6.10   
  Core                  Internal Dynamic Page Cache (dynamic_page_cache)            Enabled    8.6.10   
  Core                  Text Editor (editor)                                        Disabled   8.6.10   
  Field types           Entity Reference (entity_reference)                         Disabled   8.6.10   
  Core                  Field (field)                                               Enabled    8.6.10   
  Core (Experimental)   Field Layout (field_layout)                                 Disabled   8.6.10   
  Core                  Field UI (field_ui)                                         Enabled    8.6.10   
  Field types           File (file)                                                 Enabled    8.6.10   
  Core                  Filter (filter)                                             Enabled    8.6.10   
  Core                  Forum (forum)                                               Enabled    8.6.10   
  Web services          HAL (hal)                                                   Disabled   8.6.10   
  Core                  Help (help)                                                 Disabled   8.6.10   
  Core                  History (history)                                           Enabled    8.6.10   
  Field types           Image (image)                                               Enabled    8.6.10   
  Core                  Inline Form Errors (inline_form_errors)                     Disabled   8.6.10   
  Multilingual          Language (language)                                         Enabled    8.6.10   
  Core (Experimental)   Layout Builder (layout_builder)                             Disabled   8.6.10   
  Core                  Layout Discovery (layout_discovery)                         Disabled   8.6.10   
  Field types           Link (link)                                                 Disabled   8.6.10   
  Multilingual          Interface Translation (locale)                              Enabled    8.6.10   
  Core                  Media (media)                                               Disabled   8.6.10   
  Core (Experimental)   Media library (media_library)                               Disabled   8.6.10   
  Core                  Custom Menu Links (menu_link_content)                       Disabled   8.6.10   
  Core                  Menu UI (menu_ui)                                           Disabled   8.6.10   
  Migration             Migrate (migrate)                                           Enabled    8.6.10   
  Migration             Migrate Drupal (migrate_drupal)                             Enabled    8.6.10   
  Core (Experimental)   Migrate Drupal Multilingual (migrate_drupal_multilingual)   Enabled             
  Migration             Migrate Drupal UI (migrate_drupal_ui)                       Enabled    8.6.10   
  Core                  Node (node)                                                 Enabled    8.6.10   
  Field types           Options (options)                                           Enabled    8.6.10   
  Core                  Internal Page Cache (page_cache)                            Enabled    8.6.10   
  Core                  Path (path)                                                 Disabled   8.6.10   
  Core                  Quick Edit (quickedit)                                      Disabled   8.6.10   
  Core                  RDF (rdf)                                                   Disabled   8.6.10   
  Core                  Responsive Image (responsive_image)                         Disabled   8.6.10   
  Web services          RESTful Web Services (rest)                                 Disabled   8.6.10   
  Core                  Search (search)                                             Disabled   8.6.10   
  Web services          Serialization (serialization)                               Disabled   8.6.10   
  Core                  Settings Tray (settings_tray)                               Disabled   8.6.10   
  Core                  Shortcut (shortcut)                                         Disabled   8.6.10   
  Core                  Testing (simpletest)                                        Disabled   8.6.10   
  Core                  Statistics (statistics)                                     Disabled   8.6.10   
  Core                  Syslog (syslog)                                             Disabled   8.6.10   
  Core                  System (system)                                             Enabled    8.6.10   
  Core                  Taxonomy (taxonomy)                                         Enabled    8.6.10   
  Field types           Telephone (telephone)                                       Disabled   8.6.10   
  Field types           Text (text)                                                 Enabled    8.6.10   
  Core                  Toolbar (toolbar)                                           Enabled    8.6.10   
  Core                  Tour (tour)                                                 Disabled   8.6.10   
  Core                  Activity Tracker (tracker)                                  Disabled   8.6.10   
  Core                  Update Manager (update)                                     Enabled    8.6.10   
  Core                  User (user)                                                 Enabled    8.6.10   
  Core                  Views (views)                                               Disabled   8.6.10   
  Core                  Views UI (views_ui)                                         Disabled   8.6.10   
  Core                  Workflows (workflows)                                       Disabled   8.6.10   
  Core (Experimental)   Workspaces (workspaces)                                     Disabled   8.6.10   
  Core                  Bartik (bartik)                                             Enabled    8.6.10   
  Core                  Classy (classy)                                             Enabled    8.6.10   
  Core                  Seven (seven)                                               Enabled    8.6.10   
  Core                  Stable (stable)                                             Enabled    8.6.10   
  Core                  Stark (stark)                                               Enabled    8.6.10   
 --------------------- ----------------------------------------------------------- ---------- --------- 

"Illegal choice 0 in Book element" when switching the book outline field from anything to "- None - "

$
0
0

Steps to reproduce:

  • enable the book module
  • go to any node add page where the book outline is enabled, e.g. node/add/book
  • click on the book outline
  • select "Create a new book"
  • select "none"

The error message "An illegal choice has been detected. Please contact the site administrator." will be displayed.

This is logged:

Location: /node/add/book?_wrapper_format=drupal_ajax&ajax_form=1
Referrer: /node/add/book
Message: Illegal choice 0 in Book element.

Sort sniffs/rules in phpcs.xml.dist and write test to keep them sorted

$
0
0

Problem/Motivation

As discussed in #3134731: Update coder to 8.3.9 with @longwave and @jonathan1055, we propose to have phpcs.xml.dist sorted by rule and by sniff. This will assist any work when a new sniff is added. A test will be written to ensure that any patch which adds a new sniff puts it in the correct place.

Furthermore in another issue #3135935: Keep all sniffs in phpcs.xml.dist in sync with the list got from the locked version of coder a proposal to redesign phpcs.xml.dist and write a test to ensure all sniffs (either commented out or not) are in sync with the full list got from the locked version of coder.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support for SQLite in memory database

$
0
0

When developing Kernel test, it was found that after applying the patch, that the time to run Kernel test was reduced by between 25% and 33%. Before applying the patch, the code created a file database called ':memory:' in the application root directory and to remove it and not use the SQLite in memory database functionality.

Here is example XML element in phpunit.xml for file based SQLite database in the /tmp directory called test.sqlite.
<env name="SIMPLETEST_DB" value="sqlite://localhost//tmp/test.sqlite"/>

Here is example XML element in phpunit.xml for file based SQLite database in the application root directory called test.sqlite.
<env name="SIMPLETEST_DB" value="sqlite://localhost/test.sqlite"/>

Here is example XML element in phpunit.xml for in memory SQLite database
<env name="SIMPLETEST_DB" value="sqlite://localhost/:memory:"/>;

See http://php.net/manual/en/ref.pdo-sqlite.connection.php for more information about using a in memory database.

Please note

  • In memory database is not shared between the client and server programs when running Functional or Functional-JavaScript unit tests and hence failures.
  • A database is not needed for Unit tests.

Image styles description

Some minor bugs in media module

$
0
0

FILE: E:\xampp\htdocs\drupal9test\core\modules\media\media.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------

FILE: E:\xampp\htdocs\drupal9test\core\modules\media\media.module
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
344 | ERROR | Type hint "array" missing for $allowed_bundles
----------------------------------------------------------------------

FILE: E:\xampp\htdocs\drupal9test\core\modules\media\src\Annotation\MediaSource.php
-----------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------
93 | ERROR | Doc comment short description must start with a capital letter
102 | ERROR | Doc comment short description must start with a capital letter
-----------------------------------------------------------------------------------

Move locale js scripts to a js folder

$
0
0

Move locale js scripts to a js folder

The database connection is not serializable.

$
0
0

The LocaleTranslation service is missing the DependencySerializationTrait. This causes the following to appear when multi-step forms are cached in between form rebuilds, and probably other scenarios as well.

"The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution."

Patch coming that adds the trait. Note that the CustomStrings service uses this trait already.

User::setExistingPassword() does not return $this for chaining

$
0
0

The documentation for \Drupal\user\UserInterface::setExistingPassword states that the $this is the return value:

  /**
   * Sets the existing plain text password.
   *
   * Required for validation when changing the password, name or email fields.
   *
   * @param string $password
   *   The existing plain text password of the user.
   *
   * @return $this
   */
  public function setExistingPassword($password);

However, \Drupal\user\Entity\User::setExistingPassword does not return a value:

  /**
   * {@inheritdoc}
   */
  public function setExistingPassword($password) {
    $this->get('pass')->existing = $password;
  }

I'll add a patch to the comments.

Chain File setters

$
0
0

Problem/Motivation

The file setter functions do not return $this, and do not chain. This is inconsistent with many other objects.

Proposed resolution

Make the file setter functions chain, and use it in a few uncontroversial places to prove/test that they work.

Remaining tasks

Apply setter in more places, where it makes sense, and as that code is changed.

User interface changes

None

API changes

The File setter functions will return $this where they previously returned nothing. This is backwards compatible.

Data model changes

None

Release notes snippet

The File setter functions setFilename(), setFileUri(), setMimetype(), setSize(), setPermanent(), and setTemporary() now return $this and can be used in chained operations.

Create a method of filtering one field by its relation to another field


/admin/reports/status should not WSOD if it finds an extension missing core_version_requirement in its info.yml file

$
0
0

Problem/Motivation

Site maintainers want to load the /admin/reports/status page while building & upgrading their site.

Currently with 9.0.x if a module or theme is found which does not have the expected "core_version_requirement" value in its .info.yml file the /admin/reports/status, admin/module, admin/appearce page and probably others will crash with this error (for the module "restui"):

Drupal\Core\Extension\InfoParserException: The 'core_version_requirement' key must be present in modules/contrib/restui/restui.info.yml in Drupal\Core\Extension\InfoParserDynamic->parse() (line 73 of core/lib/Drupal/Core/Extension/InfoParserDynamic.php).

The problem will happen if visit /admin/modules other clear caches. After this happens many pages will have the problem.

Proposed resolution

Fix the error so that the /admin/reports/status page loads and other page load and just displays an error message about the incompatible module.

Remaining tasks

  • Identify the root cause of the problem.
  • Provide test coverage that illustrates the problem.
  • Provide a fix for the problem.

User interface changes

TBD

API changes

TBD? Shouldn't be necessary.

Data model changes

TBD? Shouldn't be necessary.

Release notes snippet

n/a?

Fix comparison in ProtectedUserFieldConstraintValidator

$
0
0

If a user (with administer users permission) has no email address set and it edits it's user profile then the validation in ProtectedUserFieldConstraint fails for the mail field because the current implementation tries to compare arrays with a different structure. Field API returns a nested array with an empty "" (string) value for the mail field.

Migrate d7 menu language content settings

$
0
0

Problem/Motivation

The d7 menu language settings need to be migrated.

Proposed resolution

Use the taxonomy vocabulary language settings migration as a guide for the settings and do the same for menu.

Remaining tasks

content_moderation_update_8700 Fails

$
0
0

When i am updating from 8.7.12 to 8.8.5 this hook update fails.

function content_moderation_update_8700() {
  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  $entity_type = $definition_update_manager->getEntityType('content_moderation_state');
  $keys = $entity_type->getKeys();
  $keys['owner'] = 'uid';
  $entity_type->set('entity_keys', $keys);
  $definition_update_manager->updateEntityType($entity_type);
  $definition_update_manager->updateFieldStorageDefinition($definition_update_manager->getFieldStorageDefinition('uid', 'content_moderation_state'));
}

I am getting error as calling getKeys() as null.

Please help me on this, because of this, the other updates were stopped.

Deprecate drupal_get_path() and drupal_get_filename() and replace with ExtensionList::getPath() and ExtensionList::getPathname()

$
0
0

Problem/Motivation

After the completion of the new Extension system API's in #2208429: Extension System, Part III: ExtensionList, ModuleExtensionList and ProfileExtensionList and #2659940: Extension System, Part III: ThemeExtensionList and ThemeEngineExtensionList, drupal_get_path() has been replaced with the theme, module and profile extension listing services. This issue will deprecate the usage of drupal_get_path() in core and replace with the relevant extension listing service calls (Module|Profile|Theme)ExtensionList::getPath().

Proposed resolution

Replace all dynamic uses drupal_get_path() with (Module|Profile|Theme)ExtensionList::getPath(). The earlier issue #2351919: Replace uses of drupal_get_path() with __DIR__ where possible had taken care of static includes where relative location of the files were fixed.

Remaining tasks

Reviews
Commit
Update documentation & related examples like: https://api.drupal.org/api/drupal/core!modules!ckeditor!ckeditor.api.php...

User interface changes

None

API changes

drupal_get_path() is deprecated.

Viewing all 305144 articles
Browse latest View live


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