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

Add custom #required_message support to ManagedFile elements.

$
0
0

Problem/Motivation

ManagedFile elements do not support the custom #required_message property.

@see #742344: Allow forms to set custom validation error messages on required fields
@see https://drupal.stackexchange.com/questions/263391/custom-required-field-...

Proposed resolution

Add custom #required_message support to ManagedFile elements.

Copy #required_message code from \Drupal\Core\Form\FormValidator::doValidateForm to \Drupal\file\Element\ManagedFile::validateManagedFile

Remaining tasks

  • Update \Drupal\file\Element\ManagedFile::validateManagedFile
  • Write automated test

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

TBD


Integer Field have inconsistent behaviour to update number after certain digit

$
0
0

When I create integer field in user profile and save the field value. Integer field value is inconsistency to update the the input value after certain digit. we are not able to save our input value properly. After certain digit it replaces the the value with previous saved value or any fixed value.

Submitting a comment in the non default language redirects you to the default language

$
0
0

Problem/Motivation

In a multilingual site if you add a comment on a node which is in the default language, everything is okay.
But if you add a comment on a node which is not in the default language, I get redirected to the default language translation of the node.

This is very confusing for the end user and they should stay in the same node language after submitting a comment.

Steps to reproduce the issue

This is very easy to replicate on simplytest.me (choose multilingual setup).

If simplytest.me is down (as it currently appears to be), use the following:

  1. $ composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
  2. install Drupal (for example, use drush si to install Drupal in Italian):
    $ drush si standard \
      --db-url='mysql://root@127.0.0.1/some_dir' \
      --account-name="Kay V" --account-pass=silly.walk.ministry \
      --site-name=Some-Dir \
      --site-mail=noreply@example.com \
      --locale=it
  3. add other languages (e.g. Chinese (simplified), French & English) via UI at admin/config/regional/language
  4. otherwise leave defaults (e.g. skip enabling language switching block; leave Detection and selection method as Url; leave language prefixes unchanged)
  5. add an article in the default language (by default the article content type includes all entity requirements involved in this bug report) /node/add/article
  6. add a comment to the article and hit save
  7. note whether a language prefix appears in the url (no prefix should be there, as this is the default language)
  8. create a new article in another language by entering a different prefix in the url e.g. /en/node/add/article
  9. add a comment to the article and hit save
  10. note again whether a language prefix appears in the url (if the issue exists, the prefix will be missing)
  11. apply patch
  12. drop db tables
  13. repeat from step 2 above

Proposed resolution

Redirect the user to the node translation where the comment is made.

Remaining tasks

Do the patch.

User interface changes

None.

API changes

None.

Data model changes

None.

PHP message: PHP Warning: Invalid argument supplied for foreach()

$
0
0

When visiting path /admin/reports/updates gives PHP message: PHP Warning: Invalid argument supplied for foreach() in core/modules/update/update.report.inc on line 43

Ensure that ChainedFastBackend doesn't cause a fatal

$
0
0

Problem/Motivation

\Drupal\Core\Cache\ChainedFastBackend throws errors, which is problematic as its used early in the bootstrap

PHP Fatal error:  Consistent cache backend and fast cache backend cannot use the same service. in /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php on line 98
PHP Stack trace:
PHP   1. {main}() /usr/local/drush/drush.php:0
PHP   2. drush_main() /usr/local/drush/drush.php:12
PHP   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /usr/local/drush/includes/preflight.inc:66
PHP   4. drush_dispatch() /usr/local/drush/lib/Drush/Boot/BaseBoot.php:67
PHP   5. call_user_func_array:{/usr/local/drush/includes/command.inc:192}() /usr/local/drush/includes/command.inc:192
PHP   6. drush_command() /usr/local/drush/includes/command.inc:192
PHP   7. _drush_invoke_hooks() /usr/local/drush/includes/command.inc:224
PHP   8. call_user_func_array:{/usr/local/drush/includes/command.inc:373}() /usr/local/drush/includes/command.inc:373
PHP   9. drush_cache_rebuild() /usr/local/drush/includes/command.inc:373
PHP  10. drupal_rebuild() /usr/local/drush/commands/core/cache.drush.inc:291
PHP  11. Drupal\Core\DrupalKernel->prepareLegacyRequest() /home/user/www/site/docroot/core/includes/utility.inc:42
PHP  12. Drupal\Core\DrupalKernel->preHandle() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:701
PHP  13. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:543
PHP  14. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  15. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  16. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  17. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  18. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  19. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  20. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
PHP  21. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
PHP  22. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
PHP  23. _drupal_error_handler() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
PHP  24. _drupal_error_handler_real() /home/user/www/site/docroot/core/includes/bootstrap.inc:548
PHP  25. _drupal_log_error() /home/user/www/site/docroot/core/includes/errors.inc:84
PHP  26. Drupal::logger() /home/user/www/site/docroot/core/includes/errors.inc:167
PHP  27. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal.php:672
PHP  28. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  29. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:329
PHP  30. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  31. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  32. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  33. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  34. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  35. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  36. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  37. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  38. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  39. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  40. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  41. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  42. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  43. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
PHP  44. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
PHP  45. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98

Fatal error: Consistent cache backend and fast cache backend cannot use the same service. in /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php on line 98

Call Stack:
    0.0001     228416   1. {main}() /usr/local/drush/drush.php:0
    0.0013     395528   2. drush_main() /usr/local/drush/drush.php:12
    0.3716   10195688   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /usr/local/drush/includes/preflight.inc:66
    0.5580    9315344   4. drush_dispatch() /usr/local/drush/lib/Drush/Boot/BaseBoot.php:67
    0.7797   13108456   5. call_user_func_array:{/usr/local/drush/includes/command.inc:192}() /usr/local/drush/includes/command.inc:192
    0.7797   13108808   6. drush_command() /usr/local/drush/includes/command.inc:192
    0.7801   13114136   7. _drush_invoke_hooks() /usr/local/drush/includes/command.inc:224
    0.7811   13166896   8. call_user_func_array:{/usr/local/drush/includes/command.inc:373}() /usr/local/drush/includes/command.inc:373
    0.7811   13167312   9. drush_cache_rebuild() /usr/local/drush/includes/command.inc:373
    0.7839   13435120  10. drupal_rebuild() /usr/local/drush/commands/core/cache.drush.inc:291
    0.7939   13803784  11. Drupal\Core\DrupalKernel->prepareLegacyRequest() /home/user/www/site/docroot/core/includes/utility.inc:42
    2.2888   32289112  12. Drupal\Core\DrupalKernel->preHandle() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:701
    2.3052   33536928  13. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:543
    2.3055   33609288  14. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3055   33609816  15. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3060   33615504  16. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3060   33618552  17. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3065   33633840  18. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3065   33634304  19. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3069   33649496  20. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
    2.3079   33712408  21. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
    2.3079   33712648  22. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
    2.3079   33713920  23. _drupal_error_handler() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
    2.3079   33713920  24. _drupal_error_handler_real() /home/user/www/site/docroot/core/includes/bootstrap.inc:548
    2.3102   33911696  25. _drupal_log_error() /home/user/www/site/docroot/core/includes/errors.inc:84
    2.3133   34216936  26. Drupal::logger() /home/user/www/site/docroot/core/includes/errors.inc:167
    2.3133   34216984  27. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal.php:672
    2.3134   34225784  28. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3134   34226040  29. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:329
    2.3134   34226480  30. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34230424  31. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34230424  32. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3135   34230864  33. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34238312  34. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34238312  35. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3135   34238840  36. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34245640  37. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34245640  38. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3136   34246840  39. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3136   34249896  40. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3136   34250336  41. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3136   34250672  42. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3137   34250672  43. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
    2.3137   34251248  44. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
    2.3137   34251488  45. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98

PHP Fatal error:  Uncaught exception 'Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException' with message 'Circular reference detected for service "config.factory", path: "module_handler -> cache.bootstrap -> logger.factory -> logger.syslog -> config.factory -> config.storage -> cache.config -> string_translation -> string_translator.locale.lookup".' in /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:147
Stack trace:
#0 /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(494): Drupal\Component\DependencyInjection\Container->get('config.factory', 1)
#1 /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(236): Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters(Object(stdClass))
#2 /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createServ in /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 147
PHP Stack trace:
PHP   1. {main}() /usr/local/drush/drush.php:0
PHP   2. drush_main() /usr/local/drush/drush.php:12
PHP   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /usr/local/drush/includes/preflight.inc:66
PHP   4. drush_dispatch() /usr/local/drush/lib/Drush/Boot/BaseBoot.php:67
PHP   5. call_user_func_array:{/usr/local/drush/includes/command.inc:192}() /usr/local/drush/includes/command.inc:192
PHP   6. drush_command() /usr/local/drush/includes/command.inc:192
PHP   7. _drush_invoke_hooks() /usr/local/drush/includes/command.inc:224
PHP   8. call_user_func_array:{/usr/local/drush/includes/command.inc:373}() /usr/local/drush/includes/command.inc:373
PHP   9. drush_cache_rebuild() /usr/local/drush/includes/command.inc:373
PHP  10. drupal_rebuild() /usr/local/drush/commands/core/cache.drush.inc:291
PHP  11. Drupal\Core\DrupalKernel->prepareLegacyRequest() /home/user/www/site/docroot/core/includes/utility.inc:42
PHP  12. Drupal\Core\DrupalKernel->preHandle() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:701
PHP  13. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:543
PHP  14. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  15. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  16. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  17. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  18. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  19. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  20. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
PHP  21. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
PHP  22. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
PHP  23. _drupal_error_handler() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
PHP  24. _drupal_error_handler_real() /home/user/www/site/docroot/core/includes/bootstrap.inc:548
PHP  25. _drupal_log_error() /home/user/www/site/docroot/core/includes/errors.inc:84
PHP  26. Drupal::logger() /home/user/www/site/docroot/core/includes/errors.inc:167
PHP  27. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal.php:672
PHP  28. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  29. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:329
PHP  30. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  31. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  32. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  33. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  34. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  35. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  36. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  37. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  38. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
PHP  39. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
PHP  40. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
PHP  41. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  42. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
PHP  43. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
PHP  44. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
PHP  45. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98

Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException' with message 'Circular reference detected for service "config.factory", path: "module_handler -> cache.bootstrap -> logger.factory -> logger.syslog -> config.factory -> config.storage -> cache.config -> string_translation -> string_translator.locale.lookup".' in /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 147

Call Stack:
    0.0001     228416   1. {main}() /usr/local/drush/drush.php:0
    0.0013     395528   2. drush_main() /usr/local/drush/drush.php:12
    0.3716   10195688   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /usr/local/drush/includes/preflight.inc:66
    0.5580    9315344   4. drush_dispatch() /usr/local/drush/lib/Drush/Boot/BaseBoot.php:67
    0.7797   13108456   5. call_user_func_array:{/usr/local/drush/includes/command.inc:192}() /usr/local/drush/includes/command.inc:192
    0.7797   13108808   6. drush_command() /usr/local/drush/includes/command.inc:192
    0.7801   13114136   7. _drush_invoke_hooks() /usr/local/drush/includes/command.inc:224
    0.7811   13166896   8. call_user_func_array:{/usr/local/drush/includes/command.inc:373}() /usr/local/drush/includes/command.inc:373
    0.7811   13167312   9. drush_cache_rebuild() /usr/local/drush/includes/command.inc:373
    0.7839   13435120  10. drupal_rebuild() /usr/local/drush/commands/core/cache.drush.inc:291
    0.7939   13803784  11. Drupal\Core\DrupalKernel->prepareLegacyRequest() /home/user/www/site/docroot/core/includes/utility.inc:42
    2.2888   32289112  12. Drupal\Core\DrupalKernel->preHandle() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:701
    2.3052   33536928  13. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:543
    2.3055   33609288  14. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3055   33609816  15. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3060   33615504  16. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3060   33618552  17. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3065   33633840  18. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3065   33634304  19. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3069   33649496  20. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
    2.3079   33712408  21. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
    2.3079   33712648  22. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
    2.3079   33713920  23. _drupal_error_handler() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
    2.3079   33713920  24. _drupal_error_handler_real() /home/user/www/site/docroot/core/includes/bootstrap.inc:548
    2.3102   33911696  25. _drupal_log_error() /home/user/www/site/docroot/core/includes/errors.inc:84
    2.3133   34216936  26. Drupal::logger() /home/user/www/site/docroot/core/includes/errors.inc:167
    2.3133   34216984  27. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal.php:672
    2.3134   34225784  28. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3134   34226040  29. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:329
    2.3134   34226480  30. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34230424  31. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34230424  32. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3135   34230864  33. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34238312  34. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34238312  35. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3135   34238840  36. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34245640  37. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34245640  38. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3136   34246840  39. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3136   34249896  40. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3136   34250336  41. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3136   34250672  42. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3137   34250672  43. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
    2.3137   34251248  44. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
    2.3137   34251488  45. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98

Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "config.factory", path: "module_handler -> cache.bootstrap -> logger.factory -> logger.syslog -> config.factory -> config.storage -> cache.config -> string_translation -> string_translator.locale.lookup". in /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 147

Call Stack:
    0.0001     228416   1. {main}() /usr/local/drush/drush.php:0
    0.0013     395528   2. drush_main() /usr/local/drush/drush.php:12
    0.3716   10195688   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /usr/local/drush/includes/preflight.inc:66
    0.5580    9315344   4. drush_dispatch() /usr/local/drush/lib/Drush/Boot/BaseBoot.php:67
    0.7797   13108456   5. call_user_func_array:{/usr/local/drush/includes/command.inc:192}() /usr/local/drush/includes/command.inc:192
    0.7797   13108808   6. drush_command() /usr/local/drush/includes/command.inc:192
    0.7801   13114136   7. _drush_invoke_hooks() /usr/local/drush/includes/command.inc:224
    0.7811   13166896   8. call_user_func_array:{/usr/local/drush/includes/command.inc:373}() /usr/local/drush/includes/command.inc:373
    0.7811   13167312   9. drush_cache_rebuild() /usr/local/drush/includes/command.inc:373
    0.7839   13435120  10. drupal_rebuild() /usr/local/drush/commands/core/cache.drush.inc:291
    0.7939   13803784  11. Drupal\Core\DrupalKernel->prepareLegacyRequest() /home/user/www/site/docroot/core/includes/utility.inc:42
    2.2888   32289112  12. Drupal\Core\DrupalKernel->preHandle() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:701
    2.3052   33536928  13. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Core/DrupalKernel.php:543
    2.3055   33609288  14. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3055   33609816  15. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3060   33615504  16. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3060   33618552  17. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3065   33633840  18. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3065   33634304  19. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3069   33649496  20. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
    2.3079   33712408  21. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
    2.3079   33712648  22. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
    2.3079   33713920  23. _drupal_error_handler() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
    2.3079   33713920  24. _drupal_error_handler_real() /home/user/www/site/docroot/core/includes/bootstrap.inc:548
    2.3102   33911696  25. _drupal_log_error() /home/user/www/site/docroot/core/includes/errors.inc:84
    2.3133   34216936  26. Drupal::logger() /home/user/www/site/docroot/core/includes/errors.inc:167
    2.3133   34216984  27. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal.php:672
    2.3134   34225784  28. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3134   34226040  29. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:329
    2.3134   34226480  30. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34230424  31. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34230424  32. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3135   34230864  33. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34238312  34. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34238312  35. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3135   34238840  36. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3135   34245640  37. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3135   34245640  38. Drupal\Component\DependencyInjection\Container->resolveServicesAndParameters() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:236
    2.3136   34246840  39. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:494
    2.3136   34249896  40. Drupal\Component\DependencyInjection\Container->createService() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:177
    2.3136   34250336  41. call_user_func_array:{/home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254}() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3136   34250672  42. Drupal\Core\Cache\CacheFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:254
    2.3137   34250672  43. Drupal\Core\Cache\ChainedFastBackendFactory->get() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/CacheFactory.php:83
    2.3137   34251248  44. Drupal\Core\Cache\ChainedFastBackend->__construct() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackendFactory.php:82
    2.3137   34251488  45. trigger_error() /home/user/www/site/docroot/core/lib/Drupal/Core/Cache/ChainedFastBackend.php:98
    2.3147   34251792  46. drush_shutdown() /usr/local/drush/includes/preflight.inc:0
    2.3148   34253768  47. dt() /usr/local/drush/includes/preflight.inc:738
    2.3149   34254952  48. Drupal::translation() /usr/local/drush/includes/output.inc:163
    2.3149   34255000  49. Drupal\Component\DependencyInjection\Container->get() /home/user/www/site/docroot/core/lib/Drupal.php:592

Steps to reproduce:

  1. Checkout 8.1.x
  2. Install syslog
  3. Checkout 8.2.x
  4. Boom

Proposed resolution

* Fallthrough instead of throwing an error/exception

Remaining tasks

User interface changes

API changes

Data model changes

No close button on dialog (modal)

$
0
0

When invoking a modal / dialog using stable as the base theme, no close button is shown in the upper right corner.

no button

White background leak on dropbutton-widget when hovered over table row

$
0
0

There's a white background leak on dropbutton-widget that only can be seen on hover

Where to see this?:
The issue seems to happen on pages with a lists of rows in a table that has dropbutton-widget, but only I only found it occuring in translate lists for entities such as node or blocks, i.e: node/nid/translations

Here's a screenshot with higher contrast on hover:
A button with white background leak on hover in Seven theme

Seven Theme Vertical Tabs Appear as Bulleted List

$
0
0

After upgrading to Drupal 8.7.5 on a site that uses the Seven theme for the Administrative Theme, the vertical tabs started appearing as a bulleted list.

This is related to the issue "Fix RTL styles of Vertical tabs in Seven Theme (3055760)". It changed the CSS file used for the vertical tabs in Seven's info.yml file to use the following:

core/drupal.vertical-tabs:
css:
component:
/core/themes/stable/css/core/vertical-tabs.css: false

The Stable Theme's vertical-tabs.css file does not have the style for the vertical-tabs__menu class. Specifically this property is missing:
list-style: none;

I propose adding that property to core/themes/seven/css/components/vertical-tabs.css


Allow Drupal to work with Composer 2

$
0
0

Problem/Motivation

Composer 2 is on its way, and may provide benefits to Drupal sites. It should be possible to use Composer 2 to run commands such as require, update and install on Drupal sites.

https://github.com/composer/composer/blob/master/CHANGELOG.md#200--2020-

Proposed resolution

  • Declare that our plugins work with the ^2 Composer API
  • Implement the new methods of the Composer 2.x plugin interface
  • Upgrade to composer/installers ^1.9 (earlier versions are not compatible with the Composer 2 plugin API)
  • Remove wikimedia/composer-merge plugin
  • Call OperationInterface:: getOperationType() instead of OperationInterface::getJobType() (renamed in Compsoer 2)
  • Skip tests that will not work with Composer 2 until there is a stable release of our Composer plugins that are compatible with Composer 2.

Note that Drupal also has Composer dependencies internally, including composer/composer (require-dev only) and composer/semver (required in drupal/core). Updating these components cannot be done until there is a stable release available; therefore, updating these components is out of scope for this issue. See below.

Remaining tasks

User interface changes

None

API changes

Drupal must react to some Composer API changes, as mentioned above; however, no APIs defined by Drupal change.

Data model changes

None

Release notes snippet

The Composer plugins provided by Drupal -- the scaffold plugin, the vendor hardening plugin, and the project message plugin -- are now compatible with Composer 2.

`link` fields in REST, JSON:API and GraphQL cannot be rendered by client

$
0
0

Problem/Motivation

Link fields and menu links are output in JSON:API in the following format:

"field_link": [
  {
    "uri": "internal:/",
    "title": "Home",
    "options": [
    ]
  },
  {
    "uri": "entity:node/5",
    "title": "News Center",
    "options": [
    ]
  }
]
"link": {
  "uri": "entity:node/5",
  "title": "",
  "options": [   
  ]
},

This isn't very useful for anything consuming the API because it needs to process these links. In most cases the data can't be fetched because it's unknown what node type is being referenced, and so which endpoint to query is unknown. If this was known, then it would require a lot of unnecessary requests to get the links from various bundle endpoints.

Proposed resolution

Add a computed url property at \Drupal\link\Plugin\Field\FieldType\LinkItem::propertyDefinitions()

Remaining tasks

Write code

User interface changes

None

API changes

An additional property is added to link objects

Data model changes

None

Release notes snippet

tbd

[8.9 only] Increase recommended PHP version to 7.3 prior to release

$
0
0

Problem/Motivation

Currently, Drupal 8.9's recommended PHP version is 7.2, which will be EOL before 8.9 is.

Proposed resolution

Increase the recommended PHP version to 7.3.

Remaining tasks

User interface changes

Sites on 7.2 will now see the status report info message:

It is recommended to upgrade to PHP version 7.3 or higher for the best ongoing support. See PHP's version support documentation and the Drupal 8 PHP requirements handbook page for more information.

Before

Status report on site running PHP 7.2 before the patch, no warning.

After

Status report on site running PHP 7.2 after the patch, warning shown (but no errors).

API changes

None.

Data model changes

None.

Release notes snippet

Drupal 8.9 runs on all PHP 7 versions; however, it is recommended to update to at least PHP 7.3. Only PHP 7.3 and 7.4 are supported by the PHP maintainers until Drupal 8.9's end-of-life in November 2021.

Improve exception messages when plugins cannot be found

$
0
0

Problem/Motivation

Currently, when a plugin cannot be found, we get this obtuse error message:

Drupal\Component\Plugin\Exception\PluginException: The plugin (%plugin) did not specify an instance class in Drupal\Component\Plugin\Factory\DefaultFactory->getPluginClass() (line 60 of /path/to/webroot/core/lib/Drupal/Component/Plugin/Factory/DefaultFactory.php).

first, this is incorrect - what's usually happening is that no plugin definition was found, not that the found plugin definition did not specify an instance class. second, it gives us very little useful information about WHICH plugin actually failed - we just have the plugin id, not the owner/type information. that's a little tricky to get at.

Proposed resolution

introduce new exceptions - PluginNotFoundException and DerivativeNotFoundException - that can be thrown by the various Discovery implementations when plugins aren't actually found.

Remaining tasks

the exceptions still don't include contextual information about the plugin type when throwing exceptions. we could probably expand the DiscoveryInterface to include such contextual information purely for the purpose of these exceptions.

API changes

any new Discovery classes, decorators, etc., should follow the practice of throwing the appropriate exception for their case.

Replace assertions involving calls to in_array() with assertContains()/assertNotContains()

$
0
0

Problem/Motivation

Fox example:

-    $this->assertFalse(in_array('t3', $cids), "Existing key 3 has been removed from &\$cids");
-    $this->assertTrue(in_array('t4', $cids), "Non existing key 4 is still in &\$cids");
+    $this->assertNotContains('t3', $cids);
+    $this->assertContains('t4', $cids);

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Let the hook cache store arbitrary callbacks instead of module names

$
0
0

Currently the hook cache is an array of the format $module_name => $group.

We also know that the hook system is fragile.
sun suggested to allow an alternative format with Drupal\$module\Hook::foo() (and other proposals existed before that):
#2237831: Allow module services to specify hooks

As a preparational step before any such move, I suggest to change the hook cache so that it can be filled with arbitrary callbacks.
For the start, these can be added with hook_module_implements_alter().

Later we can add patterns like Drupal\$module\Hook::foo() or Drupal\$module\hook_foo(). This could even happen post-release, since it would only extend the API and not break it. (unless a module already defines a class that matches the pattern.. duh)

The change of the hook cache brings only one API break: It changes the structure of hook_module_implements_alter().
hook_hook_info() will continue to work as it does today.

Challenge: We still need a way to store which files should be included for a hook implementation. We may want to store the module name and the file path relative to the module dir. This way, things don't break if modules are moved around.
This means the simple array structure of $module_name => $group no longer does the job.

Note: #2263365: Second loop in module_implements() being repeated for no reason. should be fixed first!

[policy and patch] Provide a proper mechanism for deprecating modules

$
0
0

Problem/Motivation

We don't have a formal way to deprecate modules in core. In #3062281: Deprecate block_place module for removal in Drupal 9, we deprecated the Place Block module by deprecating basically everything inside it, including the .module file itself. The module had already been hidden in a previous minor release. It was a bit tedious and ad-hoc, and took a long time to implement even though we were deprecating a module that had been already hidden for many releases.

This issue is not for defining the conditions under which a module will be deprecated; that's a separate product management discussion. Rather, it's for discussing how to deprecate a module once the decision has been made to do so.

Proposed resolution

Define a policy for how modules are deprecated, and provide a clean API to do so. This could be as simple as a deprecated: true in the module's info.yml, or maybe deprecated: "Deprecation message". (Compare #3064017: Create a means to mark an asset library as deprecated in a *.libraries.yml file).

Things that should probably happen as a result:

  • If the module is not installed on a site, it is hidden from the UI, same as hidden: true.
  • There should be a requirements warning for both install and runtime.
  • All the module's APIs should trigger deprecation errors. (Not sure if there's a clean way to do this programmatically.)
  • Automated tooling like Upgrade Status should detect and warn the user about the deprecated module.
  • Modules that have the deprecated module as a dependency should also receive a warning.

Remaining tasks

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD


Register form: roles are not set by using the account object

$
0
0

Here is the code which create the roles checkboxes in AccountForm Class

    $form['account']['roles'] = [
      '#type' => 'checkboxes',
      '#title' => $this->t('Roles'),
      '#default_value' => (!$register ? $account->getRoles() : []),
      '#options' => $roles,
      '#access' => $roles && $user->hasPermission('administer permissions'),
    ];

I would change the '#default_value' into:

'#default_value' => $account->getRoles(),

This is because, if not, the following code (in a controller) will not work:

    public function content($rid = null) {
        $user_with_role = \Drupal\user\Entity\User::create();
        if ($rid) {
            $user_with_role->addRole($rid); 
        } else {
            throw new \Symfony\Component\HttpKernel\Exception\NotFoundHttpException();
        }
        
        $form = \Drupal::entityTypeManager()
        ->getFormObject('user', 'register_by_role')
        ->setEntity($user_with_role);
        
        return \Drupal::formBuilder()->getForm($form,$rid);
    }

Assuming :

1-the route of this controller will have a role ID in the last part ($rid): path: '/register_br/{rid}'
2-'register_by_role' is a new form class which simply extend RegisterForm by using the following code:

function mymodule_entity_type_build(array &$entity_types) {
    $entity_types['user']->setFormClass('register_by_role', '\Drupal\mymodule\Form\RegisterByRoleForm');
}

Semicolon removed from query even when it is allowed

$
0
0

The Connection class removes trailing semicolons from SQL Statements, but also supports a setting to allow semicolons in statements. For some reason, SQL Server requires that a MERGE statement end in a semicolon. A good universal approach would be to change:

else {
  $this->expandArguments($query, $args);
  // To protect against SQL injection, Drupal only supports executing one
  // statement at a time.  Thus, the presence of a SQL delimiter (the
  // semicolon) is not allowed unless the option is set.  Allowing
  // semicolons should only be needed for special cases like defining a
  // function or stored procedure in SQL. Trim any trailing delimiter to
  // minimize false positives.
  $query = rtrim($query, ";  \t\n\r\0\x0B");
  if (strpos($query, ';') !== FALSE && empty($options['allow_delimiter_in_query'])) {
    throw new \InvalidArgumentException('; is not supported in SQL strings. Use only one statement at a time.');
  }
  $stmt = $this->prepareQuery($query);
  $stmt->execute($args, $options);
}

To:

else {
  $this->expandArguments($query, $args);
  // To protect against SQL injection, Drupal only supports executing one
  // statement at a time.  Thus, the presence of a SQL delimiter (the
  // semicolon) is not allowed unless the option is set.  Allowing
  // semicolons should only be needed for special cases like defining a
  // function or stored procedure in SQL. Trim any trailing delimiter to
  // minimize false positives unless delimiter is allowed.
  $whitespace = "  \t\n\r\0\x0B";
  if (empty($options['allow_delimiter_in_query'])) {
    $whitespace .= ';';
  }
  $query = rtrim($query, $whitespace);
  if (strpos($query, ';') !== FALSE && empty($options['allow_delimiter_in_query'])) {
    throw new \InvalidArgumentException('; is not supported in SQL strings. Use only one statement at a time.');
  }
  $stmt = $this->prepareQuery($query);
  $stmt->execute($args, $options);
}

Move Bartik block config into the Bartik theme

$
0
0

Problem/Motivation

Uninstall and then re-install Bartik and you will get mixed up block mapping in theme. This shouldn't happen.

Proposed resolution

Configuration files should be with the object being configured. Move Bartik configuration files from core/profiles/standard/config/install to core/themes/bartik/config/optional. 'config/optional' is chosen rather than 'config/install' because tests may fail due to unmet dependencies.

Got AlreadyInstalledException error in all tests which were inherited from AlreadyInstalledException

$
0
0

I started to write a test for a contrib module and when I tried to run it I got an AlreadyInstalledException. After that I tried to run another core test and I realized all tests are falling with this error. I don't know it's a existing bug or just my webserver config doesn't proper.
I'm using MAMP with apache and I'm running the drupal through a virtualhost on PHP 7.0.8.

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.

Viewing all 296830 articles
Browse latest View live


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