Issues for Drupal core https://www.drupal.org/project/issues/drupal?text=&status=Open&priorities=All&categories=All&version=All&component=All en Remove the ability to update modules and themes via authorize.php https://www.drupal.org/project/drupal/issues/3491731 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>See discussion in <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3253158" title="Status: Needs work">#3253158: Add Alpha level Experimental Update Manager module</a></span> and <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3483501" title="Status: Needs work">#3483501: Rename update module back to Update Status</a></span>. I have been sure we already had an issue for this but haven't been able to find it despite at least a couple of attempts, so opening a new issue.</p> <p>With package_manager, automatic updates (update manager) and project browser coming into core, we need to completely remove this functionality so it's not implemented twice in two different ways.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ol> <li><span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/3502973" title="Status: Active">#3502973: Remove UI and routes for the ability to update modules and themes via update.module and authorize.php</a></span></li> <li><span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/3502974" title="Status: Active">#3502974: Deprecate authorize.php and the FileTransfer system</a></span></li> <li><span class="project-issue-issue-link project-issue-status-info project-issue-status-4"><a href="/project/drupal/issues/3502975" title="Status: Postponed">#3502975: [12.x] Remove all legacy code related to authorize.php and FileTransfer</a></span></li> </ol> <p>The 1st two are 11.2.0 release priorities, and each will have parts of the MR changes from here. The last one is a 12.0.0 task to finally remove everything.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ol> <li><del>Product manager review to decide if we can remove outright (see MR !10461), or need to do some horrible deprecation dance with all this code.</del></li> <li>Decide what to do with the <code class="language-php">administer software updates</code> permission. It's also used for <code class="language-php">update.php</code> (DB updates), so I think it needs to stay, but TBD.</li> <li>Decide if we can remove <code class="language-php">lib/Drupal/Core/Archiver/*</code> and related tests, too.</li> <li><del>Decide if we can outright delete all the things we deprecated in <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/3417136" title="Status: Closed (fixed)">#3417136: Remove adding an extension via a URL</a></span>, or if we should be more careful.</del></li> </ol> <h3 id="summary-ui-changes">User interface changes</h3> <p>See child issues.</p> <h3 id="summary-api-changes">API changes</h3> <p>See child issues.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Wed, 04 Dec 2024 18:55:17 +0000 catch https://www.drupal.org/project/drupal/issues/3491731 [12.x] Remove all legacy code related to authorize.php and FileTransfer https://www.drupal.org/project/drupal/issues/3502975 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Split from <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3491731" title="Status: Needs work">#3491731: Remove the ability to update modules and themes via authorize.php</a></span></p> <p>This issue is for 12.x to (finally!) remove <code class="language-php">authorize.php</code>, the <code class="language-php">FileTransfer</code> classes, and the rest of the <code class="language-php">Updater</code> classes.</p> <p>Note that "update.module" is slightly a lie for component, since it's technically all code living in "base system", but it only exists for the legacy update manager and it's effectively part of update.module.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Wed, 29 Jan 2025 02:19:00 +0000 dww https://www.drupal.org/project/drupal/issues/3502975 Deprecate authorize.php and the FileTransfer system https://www.drupal.org/project/drupal/issues/3502974 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Split from <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3491731" title="Status: Needs work">#3491731: Remove the ability to update modules and themes via authorize.php</a></span></p> <p>This issue is for 11.2.x to deprecate <code class="language-php">authorize.php</code>, the <code class="language-php">FileTransfer</code> classes, and the rest of the <code class="language-php">Updater</code> classes.</p> <p>See also:<br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/3285191" title="Status: Active">#3285191: [meta] Only support Drupal core installs managed by composer</a></span><br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3483501" title="Status: Needs work">#3483501: Rename update module back to Update Status</a></span><br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3253158" title="Status: Needs work">#3253158: Add Alpha level Experimental Update Manager module</a></span></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <p>All of these are now deprecated:</p> <ol> <li><code class="language-php">core/authorize.php</code></li> <li><code class="language-php">system_authorized_init()</code></li> <li><code class="language-php">system_authorized_get_url()</code></li> <li><code class="language-php">system_authorized_batch_processing_url()</code></li> <li><code class="language-php">system_authorized_run()</code></li> <li><code class="language-php">system_authorized_batch_process()</code></li> <li><code class="language-php">core/lib/Drupal/Core/FileTransfer/*</code></li> <li><code class="language-php">core/lib/Drupal/Core/Updater/*</code></li> <li><code class="language-php">drupal_get_filetransfer_info()</code></li> <li><code class="language-php">hook_filetransfer_info()</code></li> <li><code class="language-php">hook_filetransfer_info_alter()</code></li> <li><code class="language-php">drupal_get_updaters()</code></li> <li><code class="language-php">hook_updater_info()</code></li> <li><code class="language-php">hook_updater_info_alter()</code></li> <li><code class="language-php">hook_verify_update_archive()</code></li> </ol> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Wed, 29 Jan 2025 02:18:56 +0000 dww https://www.drupal.org/project/drupal/issues/3502974 Remove UI and routes for the ability to update modules and themes via update.module and authorize.php https://www.drupal.org/project/drupal/issues/3502973 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Split from <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3491731" title="Status: Needs work">#3491731: Remove the ability to update modules and themes via authorize.php</a></span></p> <p>This issue is for 11.2.x to remove the UI and routes related to the legacy "Update manager" parts of update.module that allow updating your existing contrib modules and themes via the core UI.</p> <p>See also:<br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/3285191" title="Status: Active">#3285191: [meta] Only support Drupal core installs managed by composer</a></span><br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3483501" title="Status: Needs work">#3483501: Rename update module back to Update Status</a></span><br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3253158" title="Status: Needs work">#3253158: Add Alpha level Experimental Update Manager module</a></span></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ol> <li>Remove the routes</li> <li>Remove the form(s)</li> <li>Remove links / local actions</li> <li>Remove mentions in help text or other UI text</li> </ol> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <p>The legacy "Update Manager" parts of <code class="language-php">update.module</code> are all gone. These routes no longer exist:</p> <ol> <li><code class="language-php">update.report_update</code> (/admin/reports/updates/update)</li> <li><code class="language-php">update.module_update</code> (/admin/modules/update)</li> <li><code class="language-php">update.theme_update</code> (/admin/appearance/update)</li> <li><code class="language-php">update.confirmation_page</code> (/admin/update/ready)</li> </ol> <p>These forms are now gone:</p> <ol> <li><code class="language-php">core/modules/update/src/Form/UpdateManagerUpdate.php</code></li> <li><code class="language-php">core/modules/update/src/Form/UpdateReady.php</code></li> </ol> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Wed, 29 Jan 2025 02:18:47 +0000 dww https://www.drupal.org/project/drupal/issues/3502973 Add a drupalGet() method to KernelTestBase https://www.drupal.org/project/drupal/issues/3390193 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Many browser tests only need to check something in the returned content of a controller. This can actually be done in a Kernel test if the functionality provided by a new drupalGet() method is utilised. </p> <p>Kernel tests are significantly faster than browser tests (see <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/3041700" title="Status: Active">#3041700: [META] Convert some tests into Kernel or Unit tests</a></span>).</p> <p>Therefore by creating this new method it will allow many existing tests to be converted to kernel tests thus speeding up the pipeline as a whole.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Use a drupalGet() method inside a Kernel test. It will not work because no KernelTestBase::drupalGet() method is currently defined.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add a trait for kernel tests which provides a drupalGet() method. This new version of the existing drupalGet() method BrowserTestBase::drupalGet() will perform the same tasks the current version does but in Kernel tests. The method should output HTML files for debugging in the same way that BrowserTestBase::drupalGet() does. </p> <p>Code added to KernelTestBase should avoid duplicating code in BrowserTestBase -- this may require code being refactored from UiHelperTrait to a new trait.</p> <p>Also to consider (for naming of traits, refactoring choices etc) is that as a follow-up, submitForm() should be made available to KernelTestBase as well.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <p>None</p> <h3 id="summary-api-changes">API changes</h3> <p>A new trait for kernel tests, HttpKernelUiHelperTrait, which allows kernel tests to make HTTP requests to the test site, and make assertions against the returned content with Mink.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>A new trait for kernel tests, HttpKernelUiHelperTrait, allows kernel tests to make HTTP requests to the test site and make assertions against the returned content with Mink. This has the potential for many browser test to be converted to kernel tests, which are much faster to run because unlike browser tests, they don't set up a test site by running the Drupal installer through browser requests.</p> <h3 id="summary-original-report">Notes from original report</h3> <p>Working-but-in-need-of-clean-up code is here:</p> <p>- Add code from <a href="https://github.com/mglaman/drupal-test-helpers/tree/main/src" rel="nofollow">https://github.com/mglaman/drupal-test-helpers/tree/main/src</a> to KernelTestBase<br /> - <a href="https://github.com/mglaman/drupal-test-helpers/commit/2dbed403a1872a3aea4b2d852a853d2616a84f16" rel="nofollow">https://github.com/mglaman/drupal-test-helpers/commit/2dbed403a1872a3aea...</a><br /> - <a href="https://git.drupalcode.org/project/layout_paragraphs/-/merge_requests/122/diffs#5034b4cf664c107f00d3c72ffd46ec66ce31bb27" rel="nofollow">https://git.drupalcode.org/project/layout_paragraphs/-/merge_requests/12...</a></p> Wed, 27 Sep 2023 15:11:33 +0000 joachim https://www.drupal.org/project/drupal/issues/3390193 Improve FileValidator help https://www.drupal.org/project/drupal/issues/3502802 <h4 id="summary-problem-motivation">Problem/Motivation</h4> <p>Improve <a href="https://api.drupal.org/api/drupal/core%21modules%21file%21src%21Validation%21FileValidator.php/class/FileValidator/11.x" rel="nofollow">FileValidator help</a></p> <h4 id="summary-remaining-tasks">Remaining tasks</h4> <ul> <li>Add help</li> <li><a href="https://www.drupal.org/docs/develop/creating-modules/subscribe-to-and-dispatch-events" rel="nofollow">Update guide</a></li> </ul> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h4 id="summary-proposed-resolution">Proposed resolution</h4> <h4 id="summary-ui-changes">User interface changes</h4> <h4 id="summary-introduced-terminology">Introduced terminology</h4> <h4 id="summary-api-changes">API changes</h4> <h4 id="summary-data-model-changes">Data model changes</h4> <h4 id="summary-release-notes">Release notes snippet</h4> Tue, 28 Jan 2025 12:47:25 +0000 vladimiraus https://www.drupal.org/project/drupal/issues/3502802 Disallow AI bots by default in robots.txt https://www.drupal.org/project/drupal/issues/3398445 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Users should be protected from AI bot(s) scraping by default. If they want to allow it, they can choose to do so after the fact by editing robots.txt or using modules like RobotsTxt. This would protect users and teams either unaware of AI bot scraping, those who don't want it, and or those who are not aware they need to be taking action (in this manner).</p> <blockquote><p> Web pages crawled with the GPTBot user agent may potentially be used to improve future models and are filtered to remove sources that require paywall access, are known to primarily aggregate personally identifiable information (PII), or have text that violates our policies. Allowing GPTBot to access your site can help AI models become more accurate and improve their general capabilities and safety. </p></blockquote> <p>I think this is a sensible change and also doesn't put full trust into ChatGPT or Google Bard not ingesting things or interpreting sensitive content as not-sensitive.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add the following to the default robots.txt to block Google and OpenAI (ChatGPT):</p> <pre class="codeblock"><code class="language-php">User-agent: GPTBot Disallow: / User-agent: CCbot Disallow: / User-agent: anthropic-ai Disallow: / User-agent: Claude-Web Disallow: / User-agent: Google-Extended Disallow: / </code></pre><p> It may also be relevant to add an ai.txt by default for a broader disallow (is this a real growing standard or proposed?).</p> <p>See also: <a href="https://site.spawning.ai/spawning-ai-txt" rel="nofollow">https://site.spawning.ai/spawning-ai-txt</a></p> Wed, 01 Nov 2023 17:22:25 +0000 kevinquillen https://www.drupal.org/project/drupal/issues/3398445 Deprecate HandlerBase defineExtraOptions https://www.drupal.org/project/drupal/issues/3485084 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>It was discovered in <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/3478172" title="Status: Closed (fixed)">#3478172: Add MissingParamType for views</a></span> that in core/modules/views/src/Plugin/views/HandlerBase.php the method defineExtraOptions() isn't used. </p> <p>Searching contrib space <a href="https://git.drupalcode.org/search?group_id=2&amp;page=2&amp;scope=blobs&amp;search=defineExtraOptions" rel="nofollow">https://git.drupalcode.org/search?group_id=2&amp;page=2&amp;scope=blobs&amp;search=d...</a> I don't think anyone is using it. So it is probably safe to deprecate it.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>N/A</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Deprecate the function</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Deprecate<br /> Deprecation test coverage<br /> Change record</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>N/A</p> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <p>N/A</p> <h3 id="summary-api-changes">API changes</h3> <p>N/A</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>N/A</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>N/A</p> Fri, 01 Nov 2024 14:12:09 +0000 smustgrave https://www.drupal.org/project/drupal/issues/3485084 Add a fallback classloader that can handle missing traits for attribute discovery https://www.drupal.org/project/drupal/issues/3502913 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>See <span class="project-issue-issue-link project-issue-status-info project-issue-status-8"><a href="/project/drupal/issues/3490322" title="Status: Needs review">#3490322: Use nickic/php-parser for attribute-based plugin discovery to avoid errors</a></span> for some discussion. This doesn't replace that issue, it just provides a possible alternative way to handle missing traits, which is part of what that issue deals with.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 19:18:30 +0000 catch https://www.drupal.org/project/drupal/issues/3502913 Change $previous argument for HttpException to \Throwable https://www.drupal.org/project/drupal/issues/3501186 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <ul> <li>Upstream bug report: <a href="https://github.com/symfony/symfony/issues/30728" rel="nofollow">https://github.com/symfony/symfony/issues/30728</a></li> <li>Upstream PR: <a href="https://github.com/symfony/symfony/pull/30729" rel="nofollow">https://github.com/symfony/symfony/pull/30729</a></li> </ul> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>Change <code class="language-php">$previous</code> argument for every child of Symfony <a href="https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/HttpKernel/Exception/HttpException.php" rel="nofollow">HttpException</a> to <code class="language-php">\Throwable</code></li> </ul> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 21 Jan 2025 15:43:51 +0000 znerol https://www.drupal.org/project/drupal/issues/3501186 Use nickic/php-parser for attribute-based plugin discovery to avoid errors https://www.drupal.org/project/drupal/issues/3490322 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Using the <a href="https://github.com/nikic/PHP-Parser" rel="nofollow">nikic/php-parser</a> library has been mentioned is a possible alternative to parsing attributes via PHP reflection, because substantive use of reflection can result in performance and memory usage concerns.</p> <p>Using nikic/php-parser to retrieve attribute values will retrieve some or all attribute values in the case of missing dependencies.</p> <p>From comment <a href="https://www.drupal.org/project/drupal/issues/3395260#comment-15875094" rel="nofollow">#12</a> on <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/3395260" title="Status: Active">#3395260: Investigate possibilities to parse attributes without reflection </a></span></p> <blockquote><p>A problem that's come up in <span class="project-issue-issue-link project-issue-status-info project-issue-status-4"><a href="/project/drupal/issues/3421014" title="Status: Postponed">#3421014: [PP-1] Convert MigrateSource plugin discovery to attributes</a></span> and <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/3458177" title="Status: Closed (fixed)">#3458177: Changing plugins from annotations to attributes in contrib leads to error if plugin extends from a missing dependency</a></span> is that attributes can't be read via Reflection on classes that implement missing interfaces, extend missing classes, or use missing traits, in the case that the missing dependency comes from an uninstalled module. While Reflection will throw an exception for a missing interface or class, PHP will fatal on a missing trait. The exception thrown during plugin discovery was handled in 3458177, but a solution for handling missing traits gracefully is still outstanding.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>For example, the migrate source plugin <code class="language-php">Drupal\block_content\Plugin\migrate\source\d7\BlockCustomTranslation</code> in the Block Content module uses <code class="language-php">Drupal\content_translation\Plugin\migrate\source\I18nQueryTrait</code> from the Content Translation module. Block Content does not have a module dependency on Content Translation, so it migrate source plugins were using attributes, discovery would lead to a PHP fatal error when Migrate and Block Content were installed, but not Content Translation.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ul> <li>Move <a href="https://github.com/nikic/PHP-Parser" rel="nofollow">nikic/php-parser</a> from a dev composer requirement to runtime</li> <li>Use nikic/php-parser on plugin classes during discovery before reflection to identify interface, class, and trait dependencies the class has that may be missing</li> <li>As an additional measure, provide a <code class="language-php">Dependencies</code> attribute that can be applied to classes. Its only property is <code class="language-php">modules</code>, which is a list of module machine names that need to be installed in order for the plugin to be discovered</li> <li>Use nikic/php-parser to check whether the plugin class has the attribute and to extract the list of module dependencies</li> <li>Avoid reflection on classes with missing dependencies and do not save to the discovery file cache</li> <li>Developers can then manually declare on their plugin classes which modules need to be installed for the plugin to be discovered like so:<br /> <pre class="codeblock"><code class="language-php">#[MigrateSource( id: 'd7_block_custom_translation', ... ] #[Dependencies(['content_translation', 'migrate_drupal'])] </code></pre><p>to ensure that discovery ignores the class and does not fatal error. </p> <p>Specifying the dependencies likely should be unnecessary, since the missing trait should have already been identified, but complex cases where a missing trait is somewhere higher in the class hierarchy would not be handled without the Dependencies attribute.</p> <p>Note that the nikic parser is not used here to replace Reflection for attribute-based plugin discovery. For now, it is only making attribute-based plugin discovery more error-resistant. </p> <p>This approach also provides a start on how attribute parsing via nikic can be done. <code class="language-php">Dependencies</code> is a simple attribute with only one array property. Plugin attribute classes can be a lot more complex, with nested object properties, so that will need further investigation in <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/3395260" title="Status: Active">#3395260: Investigate possibilities to parse attributes without reflection </a></span>. </p></li> </ul> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Make a decision per <a href="https://www.drupal.org/project/drupal/issues/3490322#comment-15879558" rel="nofollow">#8</a>:</p> <blockquote><p>So yes, someone needs to make a decision whether</p> <ol> <li> No class/trait/interface checks. Require explicit dependencies and maintain less core code.</li> <li>Middle ground: immediate classes checked with direct class_exists &amp; friends</li> <li>Whole hog. Make DrupalKernel::$classLoader public readonly, use $kernel-&gt;classLoader-&gt;findFile() to find any classes/traits/interfaces being depended on, read 'em, parse 'em and recurse with a static cache.</li> </ol> <p>I have no opinion which one is best, I merely outlined how #3 could look.</p> <p>And/or use statements could easy be parsed for non-existent modules. </p></blockquote> <p>The first two likely need <code class="language-php">nikic/php-parser</code>. The third probably doesn't, because the existing Doctrine-based StaticReflectionParser from core and migrate can do this.</p> <p>Also, the solution used here for plugin discovery could possibly be re-used on all Reflection-based discovery as it eventually expands to routes and services.</p> <h4><strong>For plugin subsystem manager and framework manager review:</strong></h4> <ul> <li>OK to use nikic/php-parser library</li> <li>Decision presented above (per #8) about which strategy to take</li> <li>Whether any of this can apply to other existing/future discovery by attributes for hooks, services, routes, and if anything should be done here to make more reusable</li> <li>Whether to refactor StaticReflectionParser to use nikic/php-parser in a followup</li> </ul> <h3 id="summary-ui-changes">User interface changes</h3> <p>N/A</p> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <p>N/A</p> <h3 id="summary-api-changes">API changes</h3> <p>N/A</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>N/A</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>N/A</p> </blockquote> Wed, 27 Nov 2024 21:08:38 +0000 godotislate https://www.drupal.org/project/drupal/issues/3490322 Review cache bin and cache tags of access policy caching https://www.drupal.org/project/drupal/issues/3500683 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>This is about two caching things in AccessPolicyProcessor.</p> <p>See <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/comment/15937139#comment-15937139" title="Status: Needs work">#3436146-9: Introduce a list of "common cache tags" to reduce lookup query amount</a></span>. The access policy includes dynamic cache tags for user roles very early in bootstrap.</p> <p>Those can't be easily preloaded and preloading them all requires more complex preloading logic.</p> <p>The question is whether it's worth to add cache tags for specific roles there. Roles typically don't change often, it might be worth to just use the list cache tag. This is relatively minor and might actually mostly go away with the ideas below for just core at least.</p> <p>The second part is that it uses a separate, new cache bin just for itself. For the database backend, this doesn't make a big difference.</p> <p>But for redis/memcache, each unique bin is a performance cost, because redis/memcache have no means to delete/invalidate across a whole bin. Redis maintains both a separate last-delete-all timestamp per bin and a cache tag for invalidateAll (See <span class="project-issue-issue-link project-issue-status-info project-issue-status-8"><a href="/project/drupal/issues/3498947" title="Status: Needs review">#3498947: Deprecate CacheBackendInterface::invalidateAll()</a></span> and <span class="project-issue-issue-link project-issue-status-info project-issue-status-2"><a href="/project/redis/issues/3500680" title="Status: Fixed">#3500680: Allow to remove support for invalidateAll() and treat it as deleteAll()</a></span>.</p> <p>Right now, the current access policy cache implementation therefore results in 5 operations based on the monitor output from <span class="project-issue-issue-link project-issue-status-info project-issue-status-2"><a href="/project/redis/issues/3498940" title="Status: Fixed">#3498940: Optimize bin cache tags and last write timetamp</a></span>:</p> <pre class="codeblock"><code class="language-php">"HGETALL" "core:access_policy:access_policies:drupal:[user.is_super_user]=1:[user.roles]=authenticated,administrator" "GET" "core:cachetags:x-redis-bin:access_policy" "GET" "core:access_policy:_redis_last_delete_all" "HGETALL" "core:access_policy:access_policies:drupal:[languages:language_interface]=en:[user.is_super_user]=1:[user.roles]=authenticated,administrator" "MGET" "core:cachetags:config:user.role.authenticated" "core:cachetags:config:user.role.administrator" "core:cachetags:access_policies" </code></pre><p> Explanation:<br /> 1. first cache get, the redirect<br /> 2. this needs to check if there was an invalidateAll() on the bin, so it checks the cache tag for it. This could be skipped with the referenced invalidateAll() issues.<br /> 3. then it needs to check if there was a deleteAll() on the bin<br /> 4. then the real cache get with the redirected cache key<br /> 5. then it checks the 3 specific cache tags in my case for admin.</p> <p>All of this is purely done to support more complex implementations that the majority of sites are actually not using. For the implementation in core, the only thing this is caching is the roles, which are in the ChainedFast config bin. </p> <p>This is a lot of lookups for what it's doing, so setting to major.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>I'm not sure. For core, it could use discovery bin, but I understand that sites using group module for example might have a lot of different cache variations. But we IMHO need a way to avoid all this overhead for the vast majority of sites that don't have expensive access policies.</p> <p>What if we add some kind of interface or method to indicate whether access policies are actually worth to cache? Group can do that, Core won't, and then we just use the static cache if none of the access policy services we have require persistent cache?</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Sat, 18 Jan 2025 22:09:00 +0000 berdir https://www.drupal.org/project/drupal/issues/3500683 CSRF token generation incompatible with optional route parameters https://www.drupal.org/project/drupal/issues/2987987 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p><code class="language-php">RouteProcessorCsrf::processOutbound()</code> does not take into account optional parameters when calculating a CSRF token, leading on-request validation to fail on a generated route in which one or more parameters were not provided at the time of generation.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Create a new custom module with a controller. You can use <code class="language-php">drush generate module </code> and <code class="language-php">drush generate controller</code> to ease the generation of files.</li> <li>Reconfigure module routing as follows:<br /> <br /><br /> <strong>my_module.routing.yml</strong> <pre class="codeblock"><code class="language-php">my_module.example: path: '/my-module/example' defaults: _title: 'Example' _controller: '\Drupal\my_module\Controller\MyModuleController::example' requirements: _permission: 'access content' options: no_cache: TRUE my_module.protected: path: '/my-module/protected/{param1}' defaults: _title: 'CSRF Protected page' _controller: '\Drupal\my_module\Controller\MyModuleController::protected' param1: '' requirements: _permission: 'access content' _csrf_token: 'TRUE' </code></pre><p><br /><br /> <strong>MyModuleController.php</strong></p> <pre class="codeblock"><code class="language-php">final class MyModuleController extends ControllerBase { public function example(): array { $url1 = Url::fromRoute('my_module.protected', ['param1' =&gt; 'value']);// --&gt; /my-module/protected/value &lt;-- Works. $url2 = Url::fromRoute('my_module.protected', ['param1' =&gt; '']);// --&gt; /my-module/protected &lt;-- Works. $url3 = Url::fromRoute('my_module.protected', ['param1' =&gt; NULL]); // --&gt; /my-module/protected &lt;-- Works. $url4 = Url::fromRoute('my_module.protected', []); // --&gt; /my-module/protected &lt;-- Will NOT work. $build['link1'] = [ '#type' =&gt; 'link', '#title' =&gt; $this-&gt;t('Link 1'), '#url' =&gt; $url1, ]; $build['link2'] = [ '#type' =&gt; 'link', '#title' =&gt; $this-&gt;t('Link 2'), '#url' =&gt; $url2, ]; $build['link3'] = [ '#type' =&gt; 'link', '#title' =&gt; $this-&gt;t('Link 3'), '#url' =&gt; $url3, ]; $build['link4'] = [ '#type' =&gt; 'link', '#title' =&gt; $this-&gt;t('Link 4'), '#url' =&gt; $url4, ]; return $build; } public function protected(): array { $build['content'] = [ '#type' =&gt; 'item', '#markup' =&gt; $this-&gt;t('It works!'), ]; return $build; } } </code></pre></li> <li>Enable the module</li> <li>Rebuild caches</li> <li>Visit the page <code class="language-php">/my-module/example</code> and click in all four links. The fourth link will not pass the CSRF validation</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Unify the code in<code class="language-php">core/lib/Drupal/Core/Access/CsrfAccessCheck.php</code> and <code class="language-php">core/lib/Drupal/Core/Access/RouteProcessorCsrf.php</code> and take into account all route parameters for the generated token.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ul> <li>[✓] - Fix</li> <li>[✓] - Test for new funcionality</li> </ul> <h3 id="summary-ui-changes">User interface changes</h3> <p>CSRF protected generated links for routes with optional parameters now work as expected.</p> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <p>None</p> <h3 id="summary-api-changes">API changes</h3> <p>None</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>NA</p> <h3 id="summary-original-report">Original report by @bradjones1</h3> <p><code class="language-php">RouteProcessorCsrf::processOutbound()</code> does not take into account optional parameters when calculating a CSRF token, leading on-request validation to fail on a generated route in which one or more parameters were not provided at the time of generation.</p> Tue, 24 Jul 2018 23:57:27 +0000 bradjones1 https://www.drupal.org/project/drupal/issues/2987987 &quot;To log in to this site, your browser must accept cookies from the domain&quot; error message displayed when user goes back and reload the page https://www.drupal.org/project/drupal/issues/3397718 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The message "To log in to this site, your browser must accept cookies from the domain" is displayed to the user when they use "Back" button and refresh the page. </p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Login with any user<br /> 2. Log out<br /> 3. Click to go back (Back button of the browser)<br /> 4. Reload the page<br /> 5. See the message</p> <p>The message is quite confusing for the user when they perform the steps above as it doesn't make sense. </p> <p>Is this by design?</p> <p><img src="/files/issues/2023-10-30/login_logout_reload_message.gif" alt="GIF showing the steps and error" /></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>In short, the proposed resolutions is to set a new cookie and add a redirect to a new <code class="language-php">verify-cookies</code> page when the <code class="language-php">check_logged_in</code> query parameter is present but there is no session for the request. This new page will ensure cookies are actually disabled before displaying an error message and the user is not just accessing a url with the <code class="language-php">check_logged_in</code> query parameter while logged out.</p> <p>This solution was inspired by comments on the original issue (<span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/2946" title="Status: Closed (fixed)">#2946: Login fails and no warning is issued if cookies are not enabled</a></span>) which suggested a double redirect approach. Except in the proposed resolution the redirects only occur for users who have cookies disabled or who directly access a url with the <code class="language-php">check_logged_in</code> query parameter when they are logged out. So it would rarely be experienced by regular users.</p> <p><strong>Details:</strong></p> <ol> <li>Keep the existing functionality that sets the <code class="language-php">check_logged_in</code> query parameter but refactor <code class="language-php">Cookie::applies</code> so that it instead sets a property on the class that can be checked by a new kernel request event listener</li> <li>Add a new kernel request event listener that checks for the new <code class="language-php">\Drupal\user\Authentication\Provider\Cookie</code> property, and if it is set to TRUE, sets a <code class="language-php">LocalRedirectResponse</code> to a new <code class="language-php">user.verify_cookies</code> route and sets a cookie that the new route will check for.</li> <li>Add a new <code class="language-php">user.verify_cookies</code> route and controller method in <code class="language-php">UserAuthenticationController</code></li> <li>The new verify cookies controller method will check for the new cookie and if it doesn't exist will display an error message as cookies are most likely disabled. If the cookie is present it will redirect the user to their original request.</li> </ol> Mon, 30 Oct 2023 14:30:58 +0000 carolpettirossi https://www.drupal.org/project/drupal/issues/3397718 Sync language list with translations (add fy, ga, hy, km, ms and sw) https://www.drupal.org/project/drupal/issues/2063055 <h3>Problem</h3> <p>We maintain a list of languages in core for which there are translations, so users get to pick a language that Drupal can actually install in. We last synced this list in <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/1295696" title="Status: Closed (fixed)">#1295696: Sync predefined list of languages with localize.drupal.org and extend native language information</a></span> and then removed languages where translations were not actually available in <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/1904214" title="Status: Closed (fixed)">#1904214: Installer auto-selects languages that don't have a translation, causing a requirements error</a></span>. Since several languages were added and got translations. We noticed Khmer and Bahasa Malaysia missing via CKEditor language mappings in <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/2050097" title="Status: Closed (fixed), Assigned to: gábor hojtsy">#2050097: Map CKEditor languages to Drupal languages</a></span>. Others were missing when comparing the online and shipped language list.</p> <h3>Proposal</h3> <p>Add the missing languages to core. The native names were taken off of localize.drupal.org directly. This is a very easy fix. I checked and there are no other languages that are missing but have translations on localize.drupal.org at this point (checked against Drupal 7.23 translations at <a href="http://ftp.drupal.org/files/translations/7.x/drupal/" rel="nofollow">http://ftp.drupal.org/files/translations/7.x/drupal/</a>). Also checked and no languages need to be removed on the grounds of no translations being available.</p> Mon, 12 Aug 2013 09:04:18 +0000 gábor hojtsy https://www.drupal.org/project/drupal/issues/2063055 Add test coverage for Field API Number https://www.drupal.org/project/drupal/issues/558362 <p>We've had some recent WSODs and critical validation errors on core Field API widgets:</p> <p><span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/557932" title="Status: Closed (fixed)">#557932: Taxonomy term field autocomplete widgets never validate, always lose values.</a></span><br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/557924" title="Status: Closed (fixed)">#557924: Options widget broken</a></span></p> <p>Both of these widgets have things in common: they both use custom multiple values handling. They also have something in common with other D7 core Fields: very little test coverage. The only widgets with any tests in core are text_textfield and text_textarea.</p> Mon, 24 Aug 2009 21:08:46 +0000 Anonymous https://www.drupal.org/project/drupal/issues/558362 Allow plugin service wiring via constructor parameter attributes https://www.drupal.org/project/drupal/issues/3294266 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>To wire services to a plugin, developers must implement <code class="language-php">ContainerFactoryPluginInterface</code> and a custom <code class="language-php">create()</code> method that pulls services from the container and calls the plugin constructor. This is largely boilerplate code and must be written for each plugin implementation.</p> <p>Using PHP 8 attributes, we can tag constructor parameters directly and allow the factory class to discover and inject the required services, and drop the <code class="language-php">create()</code> method entirely.</p> <p>This also has the advantage of placing the service name directly next to the parameter where it is used, instead of having to keep the <code class="language-php">create()</code> method and constructor signature in sync in two different places.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add support to ContainerFactory for Symfony's <code class="language-php">#[Autowire]</code> attribute.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Determine if there are any more edge cases to cover.</p> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <p>Plugins can now wire services by specifying an <code class="language-php">#[Autowire]</code> attribute on the each constructor parameter, instead of writing a separate <code class="language-php">create()</code> method.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 05 Jul 2022 10:11:09 +0000 longwave https://www.drupal.org/project/drupal/issues/3294266 Inappropriate error when updating a field schema with existing data https://www.drupal.org/project/drupal/issues/3502900 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When attempting to update a field's cardinality programmatically using the `EntityDefinitionUpdateManager`, an error occurs if the field is stored as a property in the entity table, but the update attempts to move the field to a dedicated field table. </p> <p>The error message is as follows: </p> <pre class="codeblock"><code class="language-php">&lt;strong&gt;TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given in array_intersect_key()&lt;/strong&gt; (line 2479 of /core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php) </code></pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4> <ol> <li>Install a fresh Drupal core with the Node module enabled.</li> <li>Create content using the "Node" entity type, and ensure the "Title" field has data stored as a property in the entity table.</li> <li>Create a custom module with the following hook or equivalent programmatic update (the code below)</li> <li>Run the update or execute the programmatic code to update the field storage definition.</li> <li>Observe the error.</li> </ol> <pre class="codeblock"><code class="language-php"> &lt;?php use Drupal\Core\Field\FieldStorageDefinitionInterface; /** * Implements hook_update_N(). */ function mymodule_update_9001() { // Update definitions and schema. /** @var \Drupal\Core\Entity\EntityDefinitionUpdateManager $manager */ $manager = \Drupal::entityDefinitionUpdateManager(); /** @var \Drupal\Core\Field\BaseFieldDefinition $definition */ $definition = $manager-&gt;getFieldStorageDefinition('title', 'node'); // Change cardinality to trigger the schema transition. $definition-&gt;setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); $manager-&gt;updateFieldStorageDefinition($definition); } </code></pre><h3 id="summary-proposed-resolution">Proposed resolution</h3> <ol> <li>Add a check in `SqlContentEntityStorageSchema::hasColumnChanges()` to identify schema transitions where a field moves from being stored as a property in the entity table to a dedicated field table.<br /> This check will correctly detect schema transitions and allow the system to throw a meaningful exception instead of a generic error. </li> <li>Ensure that when such a schema transition is detected, the system throws a `FieldStorageDefinitionUpdateForbiddenException` with a clear message, such as:<br /> <code class="language-php">The SQL storage cannot change the schema for an existing field (title in node entity) with data.</code> </li> </ol> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 18:13:25 +0000 usingsession https://www.drupal.org/project/drupal/issues/3502900 Incorrect path used in a A11y Test Admin https://www.drupal.org/project/drupal/issues/3501457 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>As highlighted in:<br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/comment/15950346#comment-15950346" title="Status: Active">#2857808-26: Automate Accessibility Checks for Core</a></span><br /> It looks like there is an error in the admin tests.</p> <pre class="codeblock"><code class="language-php">{ name: 'Create Article', path: '/user/1/edit' }, </code></pre><p>Perhaps it should be:</p> <pre class="codeblock"><code class="language-php">{ name: 'Create Article', path: '/node/add/article?destination=/admin/content' }, </code></pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Visit: <a href="https://git.drupalcode.org/project/drupal/-/blob/11.x/core/tests/Drupal/Nightwatch/Tests/a11yTestAdmin.js" rel="nofollow">https://git.drupalcode.org/project/drupal/-/blob/11.x/core/tests/Drupal/...</a><br /> See the Create article link is pointing to the incorrect URL.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Make the Create article test use the node add path: /node/add/article?destination=/admin/content</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Fix it<br /> Review</p> Wed, 22 Jan 2025 15:52:32 +0000 the_g_bomb https://www.drupal.org/project/drupal/issues/3501457 isMultilingual() loads all languages just to check if there is more than one https://www.drupal.org/project/drupal/issues/2686079 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>For fun, I'm currently trying to get rid of as many queries as I can on a simple site. And i noticed that isMultiple() loads all languages just to count them.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>LanguageServiceProvider could store a parameter or something in the container that we can then access in ConfigurableLanguageProvider</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> Sat, 12 Mar 2016 01:40:23 +0000 berdir https://www.drupal.org/project/drupal/issues/2686079 Taxonomy Term List page is broken when users don&#039;t have permission to edit/create terms https://www.drupal.org/project/drupal/issues/3499441 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When user has access to view the list of terms/taxonomy overview page and they don't have access to manage them, the style is broken and confusing.<br /> The user sees a + SVG but no indentation. It's quite hard to distinguish between parent and child terms. </p> <p><img src="/files/issues/2025-01-13/Incorrect_Indentation.png" alt="Screenshot showing the style issue when user doesn't have access to update the terms." /></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Create a taxonomy<br /> 2. Add few terms<br /> 3. Add children terms so you can get the indentation</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Adjust the css/styling of the page</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Mon, 13 Jan 2025 16:40:11 +0000 carolpettirossi https://www.drupal.org/project/drupal/issues/3499441 Add stream wrappers to access extension files https://www.drupal.org/project/drupal/issues/1308152 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Starting from <span class="project-issue-issue-link project-issue-status-info project-issue-status-15"><a href="/project/drupal/issues/2351919" title="Status: Patch (to be ported)">#2351919: Replace uses of drupal_get_path() with __DIR__ where possible</a></span>, when the PHP code needs to <strong>include or parse</strong> files <strong>inside the module or theme directory space</strong>, will simply use <code class="language-php">_DIR_</code> instead of <code class="language-php">drupal_get_path()</code>. This is sufficient, intuitive and more performant than calling <code class="language-php">drupal_get_path()</code>.</p> <p>However, <code class="language-php">drupal_get_path()</code> is widely used to refer files (.js, .css, images, assets) outside a module or theme. This isn't very intuitive for new developers. Stream wrappers make much more sense and simplify the API for developers trying to refer directories or files from outside the current extension in code.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Introduce extension stream wrappers:</p> <table> <tr> <th>Scheme</th> <th>Description</th> </tr> <tr> <td><code class="language-php">profile://</code></td> <td>Points to the <strong>installed profile</strong> root directory.</td> </tr> <tr> <td><code class="language-php">module://{name}</code></td> <td>Points to the module <code class="language-php">{name}</code> root directory. <strong>Only enabled modules</strong> can be referred.</td> </tr> <tr> <td><code class="language-php">theme://{name}</code></td> <td>Points to the theme <code class="language-php">{name}</code> root directory. <strong>Only installed themes</strong> can be referred.</td> </tr> </table> <h3>Examples</h3> <h4>Profile: profile://</h4> <p>Assuming the <code class="language-php">standard</code> profile is installed:</p> <ul> <li>Referring a directory: <ul> <li>Actual: <code class="language-php">drupal_get_path('profile', 'standard') . '/config'</code> </li><li>Proposed: <code class="language-php">profile://config</code> </li><li>Path: <code class="language-php">core/profiles/standard/config</code> </li></ul> </li> <li>Referring a file: <ul> <li>Actual: <code class="language-php">drupal_get_path('profile', 'standard') . '/config/install/automated_cron.settings.yml'</code> </li><li>Proposed: <code class="language-php">profile://config/install/automated_cron.settings.yml</code> </li><li>Path: <code class="language-php">core/profiles/standard/config/install/automated_cron.settings.yml</code> </li></ul> </li> </ul> <h4>Module: module://</h4> <p>Assuming the <code class="language-php">node</code> module is enabled but <code class="language-php">color</code> module is not:</p> <ul> <li>Referring a directory: <ul> <li>Actual: <code class="language-php">drupal_get_path('module', 'node') . '/config'</code></li> <li>Proposed: <code class="language-php">module://node/config</code></li> <li>Path: <code class="language-php">core/modules/node/config</code></li> </ul> </li> <li>Referring a file: <ul> <li>Actual: <code class="language-php">drupal_get_path('module', 'node') . '/config/install/node.settings.yml'</code></li> <li>Proposed: <code class="language-php">module://node/config/install/node.settings.yml</code></li> <li>Path: <code class="language-php">core/modules/node/config/install/node.settings.yml</code></li> </ul> </li> <li>Referring a resource in a uninstalled or inexistent module: <ul> <li> Actual: <code class="language-php">drupal_get_path('module', 'color') . '/config'</code> </li><li>Proposed: <code class="language-php">module://color/config</code> </li><li>Path: Throws <code class="language-php">\RuntimeException</code> </li></ul> </li> </ul> <h4>Theme: theme://</h4> <p>Assuming the <code class="language-php">bartik</code> theme is installed but <code class="language-php">seven</code> theme is not:</p> <ul> <li>Referring a directory <ul> <li>Actual: <code class="language-php">drupal_get_path('theme', 'bartik') . '/config'</code></li> <li>Proposed: <code class="language-php">theme://bartik/config</code></li> <li>Path: <code class="language-php">core/themes/bartik/config</code></li> </ul> </li> <li>Referring a file <ul> <li>Actual: <code class="language-php">drupal_get_path('theme', 'bartik') . '/color/color.inc'</code></li> <li>Proposed: <code class="language-php">theme://bartik/color/color.inc</code></li> <li>Path: <code class="language-php">core/themes/bartik/color/color.inc</code></li> </ul> </li> <li>Referring a resource in a uninstalled or inexistent theme: <ul> <li>Actual: <code class="language-php">drupal_get_path('theme', 'seven') . '/config'</code></li> <li>Proposed: <code class="language-php">theme://seven/config</code></li> <li>Path: Throws <code class="language-php">\RuntimeException</code></li> </ul> </li> </ul> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ol> <li>Profiling to compare performance of the new code with the old.</li> </ol> <h3 id="summary-api-changes">API changes</h3> <p>New abstract class for extensions stream wrappers:</p> <ul> <li><code class="language-php">\Drupal\Core\StreamWrapper\ExtensionStreamBase</code></li> </ul> <p>New stream wrapper classes:</p> <ul> <li><code class="language-php">\Drupal\Core\StreamWrapper\ModuleStream</code></li> <li><code class="language-php">\Drupal\Core\StreamWrapper\ThemeStream</code></li> <li><code class="language-php">\Drupal\Core\StreamWrapper\ProfileStream</code></li> </ul> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None.</p> Thu, 13 Oct 2011 03:31:46 +0000 dave reid https://www.drupal.org/project/drupal/issues/1308152 Some of comparison with Node.nodeType uses magic number https://www.drupal.org/project/drupal/issues/3502664 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>For example, in <a href="https://git.drupalcode.org/project/drupal/-/blob/9fab23933d74c955da6adc311d79ac2815aa261e/core/misc/position.js" rel="nofollow">/misc/position.js</a>, all of comparison against Node.nodeType use number value. The Node interface has <a href="https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType" rel="nofollow">already defined constant value</a> which identifies nodeType so these values can compare with constant value.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Replace all of comparison against Node.nodeType use magic number with constant which is defined in the Node interface.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 01:48:01 +0000 tom konda https://www.drupal.org/project/drupal/issues/3502664 Revision revert links in workspace respond with 404 not found https://www.drupal.org/project/drupal/issues/3440304 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When viewing revisions inside a workspace, the view includes links that respond with 404 page not found.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. create a node<br /> 2. create a workspace<br /> 3. switch to the workspace and create a new revision of a node<br /> 4. view revisions - the revision in the workspace is shown as the current revision<br /> 5. click on revert for the other revision (i.e. the current live revision)<br /> 6. this page responds with 404</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>tbc - prevent the option of reverting to the current live revision?<br /> When reverting to other (non-current) revisions, a warning appears: "Form should not be submitted in a workspace"</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Thu, 11 Apr 2024 16:00:14 +0000 malcomio https://www.drupal.org/project/drupal/issues/3440304 handling upload limits from php.ini graciously ? https://www.drupal.org/project/drupal/issues/3502774 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>If you try to upload a file above Drupal limitation but within php.ini POST Content-Length, you l will get an informative error handled by Drupal, like 'the file you are trying to upload exceeds the limit [...]'</p> <p>If you go above POST Content-Length the ajax call return a warning and you get the rather vague message :'Oops, something went wrong. Check your browser's developer console for more details.'</p> <p>Of course, you can increase php.ini limits, but you might have other project constraints that prevent that.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Would it be possible for Drupal, to catch the error and display an error message in the same informative way ?</p> Tue, 28 Jan 2025 11:08:08 +0000 thony https://www.drupal.org/project/drupal/issues/3502774 Update manager routes are not disabled anymore when allow_authorize_operations is FALSE https://www.drupal.org/project/drupal/issues/3502835 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Our website using Drupal 10.3.5 has <code class="language-php">$settings['allow_authorize_operations'] = FALSE;</code> but we recently noticed that our devs could access <code class="language-php">/admin/reports/updates/update</code> again.</p> <p>(This was discussed privately with the security team and it was decided it could be handled publicly.)</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>You can see this vulnerability by:<br /> 1. Adding <code class="language-php">$settings['allow_authorize_operations'] = FALSE;</code> in <code class="language-php">settings.php</code><br /> 2. Empty cache<br /> 4. As a user with "administer software updates" permission browse to <code class="language-php">/admin/reports/updates/update</code></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>I think it comes from this change: <a href="https://git.drupalcode.org/project/drupal/-/commit/206a3ac2a295e6ac21a6cbe14eb745c2b11d92c3" rel="nofollow">https://git.drupalcode.org/project/drupal/-/commit/206a3ac2a295e6ac21a6c...</a><br /> The update.route_subscriber service does not have the event_subscriber tag so it is never called.<br /> If I add it, the routes are correctly protected again:</p> <pre class="codeblock"><code class="language-php"> update.route_subscriber: class: Drupal\update\Routing\UpdateRouteSubscriber arguments: ['@settings'] tags: - { name: event_subscriber } </code></pre><h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 14:49:54 +0000 prudloff https://www.drupal.org/project/drupal/issues/3502835 Allow starterkit theme generator tool to clone Olivero https://www.drupal.org/project/drupal/issues/3301173 <p>Drupal 10's new theme generator tool is intended to replace the need for creating subthemes from existing core themes. This will enable core themes to change markup without the need to take into account subthemes and backwards compatibility. </p> <p>This issue is to allow the theme generator tool to clone Olivero.</p> <h3>Things that we'll need to do:<br /> </h3> <ul> <li><s>Bring build step into Olivero - this is the ability to compile PostCSS</s></li> <li><s>Rename Olivero filenames.</s></li> <li><s>Rename functions etc</s></li> </ul> <h3>File names that will need to be renamed</h3> <ul> <li><s>All of the config items within core/themes/olivero/config</s></li> <li><s>core/themes/olivero/olivero.breakpoints.yml</s></li> <li><s>core/themes/olivero/olivero.info.yml</s></li> <li><s>core/themes/olivero/olivero.libraries.yml</s></li> <li><s>core/themes/olivero/olivero.theme</s></li> <li><s>core/themes/olivero/src/OliveroPreRender.php</s></li> </ul> <h3>File contents that will need to be renamed</h3> <ul> <li><s>Various config within /config</s></li> <li><s>Lots of comments within the JavaScript</s></li> <li><s>The JavaScript config that gets loaded at <code class="language-php">Drupal.olivero</code></s></li> <li><s>Color settings that get loaded under <code class="language-php">drupalSettings.olivero</code></s></li> <li><s>Various <code class="language-php">once</code> names (these may be able to have the namespace removed)</s></li> <li><s>Various CSS selectors (<code class="language-php">.olivero-details</code>)</s></li> <li><s>Various CSS Animation names (eg <code class="language-php">olivero-throbber</code>)</s></li> <li><s>References to Olivero in /templates (eg <code class="language-php">{% include '@olivero/includes/preload.twig' with { olivero_path: olivero_path } only %}</code>)</s></li> <li><s>Comments within /templates</s></li> <li><s>Libraries attachments (<code class="language-php">{{ attach_library('olivero/layout-views-grid') }}</code>)</s></li> <li><s>Everything olivero related in olivero.theme and theme-settings.php</s></li> </ul> <h3>To figure out</h3> <ul> <li>Tests. This all seems pretty brittle. If we change something, we need to make sure the theme generator works.</li> <li>We need to ensure that the user-supplied theme name is valid. This needs to work in the JavaScript, preprocessing, templates, etc. </li> </ul> <h3>Testing Instructions</h3> <ul> <li>Checkout the MR branch to local/gitpod</li> <li>cd into the webroot</li> <li><code class="language-php">php core/scripts/drupal generate-theme &lt;theme_machine_name&gt; --name "&lt;Theme Name&gt;" --starterkit olivero</code></li> <li>Check new theme for any files that have "olivero" in their name or file contents</li> </ul> Mon, 01 Aug 2022 19:19:25 +0000 mherchel https://www.drupal.org/project/drupal/issues/3301173 Block visibility conditions with context not saved https://www.drupal.org/project/drupal/issues/3502888 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The block visibility configuration is not saved for conditions having a context with multiple matching context providers when not the default (first) provider is selected.</p> <p>This is related to the condition plugins because adding a context definition directly to a custom block type and selecting the non-default context provider works a expected. </p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>There are multiple conditions with a context available like group types, webforms and maybe even node types. I had the issue with group types so I will use this as example.</p> <ol> <li>Install the <a href="https://www.drupal.org/project/group" rel="nofollow">group</a> module and create two group types (I have multiple group types and do not know how the UI behaves with only one type).</li> <li>Install the <a href="https://www.drupal.org/project/group_finder" rel="nofollow">group_finder</a> module to have a second group context provider available.</li> <li><em>(optionally)</em> Install the <a href="https://www.drupal.org/project/ctools" rel="nofollow">ctools</a> module.</li> <li>Go to configuration of any block. <ol> <li>For the "Group Types" condition select the "Group Finder provider.</li> <li><strong>Do not select any of the group types.</strong></li> <li>If you've installed ctools do the same for the "Group Type" condition (which is provided by ctools for all entity types).</li> <li>Save the configuration.</li> </ol> </li> <li>(In a second window) go to <code class="language-php">admin/config/development/configuration/single/export</code> and check whether the visibility condition has been exported correctly.</li> <li>Go to configuration of the same block again. <ol> <li>For the "Group Types" condition select the "Group Finder provider.</li> <li><strong>Now select at least one of the group types.</strong></li> <li>If you've installed ctools do the same for the "Group Type" condition (which is provided by ctools for all entity types).</li> <li>Save the configuration.</li> </ol> </li> <li>Repeat step 5.</li> </ol> <p>In step 5 the context will not be exported, but in step 7 it will be exported correctly.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 17:04:59 +0000 mvonfrie https://www.drupal.org/project/drupal/issues/3502888 Media Library item styles assume contextual module is present https://www.drupal.org/project/drupal/issues/3502895 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>For media item labels to be positioned correctly, the enclosing <code class="language-php">&lt;article&gt;</code> needs to be <code class="language-php">position: relative;</code>. If the page includes the contextual module libraries then the <code class="language-php">&lt;article&gt;</code> will have the <code class="language-php">.contextual-region</code> class and be styled by this bit in <code class="language-php">contextual.module.css</code></p> <pre class="codeblock"><code class="language-php">.contextual-region { position: relative; }</code></pre><p> There are legit scenarios such as <a href="https://www.drupal.org/project/experience_builder/issues/3471978#comment-15963036" rel="nofollow">this one with Experience Builder</a> where the media library is used without contextual present -- even on sites with that module enabled.</p> <p>It winds up looking like this, with the labels under the images out of place (not <strong>hugely</strong> so, but still not a great look)<br /> <img src="/files/issues/2025-01-28/Screenshot%202025-01-28%20at%2012.24.51%E2%80%AFPM.png" alt="" /></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 17:48:29 +0000 bnjmnm https://www.drupal.org/project/drupal/issues/3502895 Add an optional site title to the Navigation https://www.drupal.org/project/drupal/issues/3502908 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Some site might want to keep their Site name on the Navigation to differentiate from different Drupal sites.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add the ability to show the Site name on the Navigation. That wouldn't be mandatory, it would be optional and disabled by default. The option to enable and disable the visibility should be handled on the same page as the Logo: /admin/config/user-interface/navigation/settings</p> <p>On the Navigation, the site would be printed next to the logo taking a maximum of two lines. Site names longer than that will be trimmed.</p> <p><img src="/files/issues/2025-01-28/navigation-sitename.png" alt="" /></p> <p><a href="https://www.figma.com/design/IQNqQnxkUiFjp5GSp9E3nV/Design-System---Drupal-CMS?node-id=5041-13777&amp;t=UaMcaisXp75T42qL-1" rel="nofollow">Figma link</a>.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 18:56:41 +0000 ckrina https://www.drupal.org/project/drupal/issues/3502908 Add a trait for autowiring properties in tests https://www.drupal.org/project/drupal/issues/3464357 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently when adding services as properties in tests you need to declare the properties and initialize them in ::setUp. This is unnecessary boilerplate.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <ol> <li>Add a trait similar to AutowireTrait to initialize the services in setUp.</li> <li>Add symfony/expression-language as a dev dependency. This allows adding autowiring based on expressions rather than pure service or parameter, like for example <code class="language-php">#[AutowireProperty(expression: "service('entity_type.manager').getStorage('node')")]</code>.</li> <li>symfony/expression-language itself requires two more Symfony components through its dependency chain: symfony/cache and symfony/cache-contracts </li> </ol> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Mon, 29 Jul 2024 02:23:03 +0000 mstrelan https://www.drupal.org/project/drupal/issues/3464357 Compressed ajax_page_state[&#039;libraries&#039;] can exist in both $request-&gt;request and $request-&gt;query simultaneously https://www.drupal.org/project/drupal/issues/3502911 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p><span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/3348789" title="Status: Closed (fixed)">#3348789: Compress ajax_page_state</a></span> added compression to the <code class="language-php">ajax_page_state['libraries']</code> and a middleware to uncompress it.<br /> It first checks <code class="language-php">$request-&gt;request</code> and uncompresses that.<br /> If it wasn't found, it then checks <code class="language-php">$request-&gt;query</code> and uncompresses that.</p> <p>But what if it's in both? Then libraries are readded to the page. In the case of <code class="language-php">dialog.js</code>, that leads to</p> <pre class="codeblock"><code class="language-php">Uncaught SyntaxError: Identifier 'DrupalDialogEvent' has already been declared (at dialog.js?v=11.2-dev:1:1) </code></pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Add a modal dialog with an #ajax'd field at the same time<br /> For example, in <span class="project-issue-issue-link project-issue-status-info project-issue-status-8"><a href="/project/drupal/issues/3386762" title="Status: Needs review">#3386762: Use modals in field creation and field edit flow</a></span>.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Uncompress the libraries in both places</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Write tests</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>N/A</p> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <p>N/A</p> <h3 id="summary-api-changes">API changes</h3> <p>N/A</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>N/A</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>N/A</p> Tue, 28 Jan 2025 19:06:03 +0000 tim.plunkett https://www.drupal.org/project/drupal/issues/3502911 Integrate Umami message https://www.drupal.org/project/drupal/issues/3441100 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The existing message provided by the Umami installation profile that shows on the Toolbar hasn't been integrated on the new navigation yet.</p> <p><img src="/files/issues/2024-04-15/umami.png" alt="" /></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Create a new custom block navigation implementation that follows a design along this lines:</p> <p><img src="/files/issues/2024-04-15/umami-new.png" alt="" /></p> <p>When collapsed, only the warning icon should be shown.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>This will new to implement a custom block for the Navigation for the first time, beyond the existing menus.</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>The Umami message will appear on the new navigation.</p> <p><img src="/files/issues/2024-08-23/Screenshot%202024-08-23%20at%2012.35.52.jpg" alt="" /></p> Mon, 15 Apr 2024 14:38:32 +0000 ckrina https://www.drupal.org/project/drupal/issues/3441100 Deprecate views_field_default_views_data and related functions https://www.drupal.org/project/drupal/issues/3489415 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>It would be great to deprecate auto including .inc files defined by hook-hook-info groups.</p> <p>In order to do that we first need remove helpers from provided groups.</p> <p>This issue handles all of the functions related to views_field_default_views_data.</p> <p>We replace the functionality, then deprecate the functions and move them to the .module files. </p> <p>We use DI for the replacements only on a couple since views related dependencies need to be optional so they must be last. </p> <p><em>The hooks using these services should be converted to DI in a followup.</em></p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>N/A</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Move it to a service in the views module.<br /> Replace calls. </p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Open follow up to add dependency injection to the hook classes using this. I didn't want to add this as the first injected dependency, but also didn't want to add DI to all the hook classes using this as part of this issue.</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>N/A</p> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <p>N/A</p> <h3 id="summary-api-changes">API changes</h3> <p>Deprecated functions:<br /> views_field_default_views_data<br /> datetime_type_field_views_data_helper<br /> _views_field_get_entity_type_storage<br /> _content_moderation_views_data_object</p> <p>See cr for replacements. </p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>N/A</p> <h3 id="summary-release-notes">Release notes snippet</h3> Sun, 24 Nov 2024 01:41:35 +0000 nicxvan https://www.drupal.org/project/drupal/issues/3489415 Regression: RssResponseCdata filtering out common HTML tags from RSS feeds https://www.drupal.org/project/drupal/issues/3497758 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>After upgrading to Drupal 10.4.0, I found that our RSS feed doesn't render div, img, and style tags. Doing so breaks our RSS email structurally (div) and visually (img and style).</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Remove filtering<br /> Add XSS test</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Mon, 06 Jan 2025 22:22:57 +0000 wlofgren https://www.drupal.org/project/drupal/issues/3497758 Extend PhpUnitTestDiscoveryTest to test also PHPUnit API https://www.drupal.org/project/drupal/issues/3497327 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>In <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/3477634" title="Status: Closed (fixed)">#3477634: Ensure run-tests.sh and PHPUnit CLI run with the same list of tests to be executed</a></span>, we introduced a test checking equality between PHPUnit and TestDiscovery test discovery lists and fails if they differ.</p> <p>We used a shell process to run the PHPUnit CLI for this purpose, and interpreted the output XML file.</p> <p>PHPUnit also provides an API to retrieve the test list via PHP, avoiding the subprocess execution.</p> <p>Using directly the API has a potential to eventually drop Drupal's own test discovery process.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>For now, just add a check for the result of the API calls. Keep both CLI and API checks.</p> <p>Dropping Drupal's TestDiscovery is left to a follow-up once we are confident we no longer need that.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Sat, 04 Jan 2025 11:00:30 +0000 mondrake https://www.drupal.org/project/drupal/issues/3497327 Views HandlerBase::breakString works unexpectedly for a views with a huge amount of filters/parameters https://www.drupal.org/project/drupal/issues/3409401 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Views that generate requests with a huge amount of arguments (more than 3500) give WSOD.<br /> The issue was reproduced on commerce order view with the amount of order items more than 3500.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>It was reproduced on commerce order view with a number of order items of more than 3500, so<br /> 1. Install commerce module<br /> 2. Create an order with the number of order items more than 3500.<br /> 3. Go to the order view page.</p> <h4 id="summary-steps-reproduce">Expected result</h4> <p>Page (view) opened.</p> <h4 id="summary-steps-reproduce">Actual result</h4> <p>The website encountered an unexpected error. Please try again later.<br /> Error in the watchdog: TypeError: Cannot assign null to property Drupal\views\Plugin\views\argument\ArgumentPluginBase::$operator of type string in Drupal\views\Plugin\views\argument\NumericArgument-&gt;title() (line 63 of /usr/www/users/cbefce/web/core/modules/views/src/Plugin/views/argument/NumericArgument.php).</p> <h3 id="summary-proposed-resolution">Root cause of issue</h3> <p>web/core/modules/views/src/Plugin/views/HandlerBase::breakString gives unexpected results in case of using a string with a huge amount of filter parameters, like "N1+N2+N3....+N3500" (it breaks somewhere at a number of filters ~ 3500).<br /> The reason for that is preg_match can't handle a long string: For the longer string, the issue could be related to the length of the string causing a problem in PHP's regex engine. PHP has a limit on the size of the string it can process with regular expressions, and very long strings can lead to unexpected behavior, such as failing to match.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Fix web/core/modules/views/src/Plugin/views/HandlerBase::breakString to avoid using preg_match. </p> Mon, 18 Dec 2023 08:37:41 +0000 Ihor Ukhan https://www.drupal.org/project/drupal/issues/3409401 After selecting an image in media library remove icon is not visible https://www.drupal.org/project/drupal/issues/3501751 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>After selection of media/image in Media Library image close icon is hidden behind the image.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Install Drupal 10.4<br /> Set Claro as a default theme Or Admin theme<br /> Create a custom content type or use 'Article' or 'Basic Page' built-in type<br /> Create image field with media library and add the field to the content type<br /> Create a node of the content type<br /> Select an image in the media library field<br /> Check that the 'image remove' option is <em>not</em> visible</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>In claro's <code class="language-php">"media-library.css" class = media-library-item__remove</code> has z-index set to 1. We need to increase the z-index for remove icon to make it visible over the image.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <p><img alt="/" src="/files/issues/2025-01-23/Screenshot%202025-01-23%20at%2010.48.03%E2%80%AFPM.png" /></p> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <p>None</p> <h3 id="summary-api-changes">API changes</h3> <p>None</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>None</p> <h3 id="summary-release-notes">Release notes snippet</h3> Thu, 23 Jan 2025 14:25:17 +0000 zeeshan_khan https://www.drupal.org/project/drupal/issues/3501751 SqlBase::prepareQuery() should be called also on count https://www.drupal.org/project/drupal/issues/2833060 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Suppose that in a source plugin, extending from <code class="language-php">SqlBase</code>, you want to override <code class="language-php">SqlBase::prepareQuery()</code> and use that to add additional tags or meta-data to the query. You don't do that in <code class="language-php">::query()</code> method for some good reasons (for example you want to apply tags &amp; meta-data only after the query was defined). If a <code class="language-php">hook_query_TAG_alter()</code> that uses those tags adds a new condition then <code class="language-php">SqlBase::count()</code> is lying.</p> <p>For this reason, this is a blocker for <span class="project-issue-issue-link project-issue-status-info project-issue-status-4"><a href="/project/drupal/issues/3069776" title="Status: Postponed">#3069776: [PP-1]: SQL source plugins: allow defining conditions and join in migration yml</a></span>, which introduces some query modifications in <code class="language-php">::prepareQuery()</code> method.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Make <code class="language-php">SqlBase::count()</code> aware of <code class="language-php">SqlBase::prepareQuery()</code>.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Review / commit.</p> <p>There are no User interface, API, or data model changes.</p> Mon, 05 Dec 2016 10:53:08 +0000 claudiu.cristea https://www.drupal.org/project/drupal/issues/2833060 Block UI A11y errors identified with Axe + Nightwatch https://www.drupal.org/project/drupal/issues/3318394 <p>Blocked on <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/3293469" title="Status: Closed (fixed)">#3293469: Automated A11y tests in Nightwatch</a></span>, which performs the checks that surfaced this</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The tests added in <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/project/drupal/issues/3293469" title="Status: Closed (fixed)">#3293469: Automated A11y tests in Nightwatch</a></span> identified the following when visiting /admin/structure/block</p> <pre class="codeblock"><code class="language-php"> ✖ NightwatchAssertError 08:56:50 aXe rule: color-contrast - Elements must have sufficient color contrast 08:56:50 In element: .region-hero-message &gt; td[colspan="5"] &gt; em 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: color-contrast - Elements must have sufficient color contrast 08:56:50 In element: .region-sidebar-message &gt; td[colspan="5"] &gt; em 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: color-contrast - Elements must have sufficient color contrast 08:56:50 In element: .region-content_below-message &gt; td[colspan="5"] &gt; em 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: color-contrast - Elements must have sufficient color contrast 08:56:50 In element: .region-footer_top-message &gt; td[colspan="5"] &gt; em 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-header &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-primary_menu &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-secondary_menu &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-hero &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-highlighted &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-breadcrumb &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-social &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-content_above &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-content &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-sidebar &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-content_below &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-footer_top &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: duplicate-id-active - IDs of active elements must be unique 08:56:50 In element: .region-title-footer_bottom &gt; td[colspan="5"] &gt; .region-title__action.js-form-wrapper.form-wrapper 08:56:50 ✖ NightwatchAssertError 08:56:50 aXe rule: region - All page content should be contained by landmarks 08:56:50 In element: #secondary-tabs-title</code></pre><p> Things to consider:</p> <ul> <li>It may be easier to split this into multiple issues</li> <li>These tests were performed with Claro as theme, so it is possible some A11y fails are Claro specific, vs. originating from the Block module. For any given issue where that is the case, change the Component to Claro. </li> <li>If any of the a11y errors are considered acceptable (either false positives or there's a tradeoff that provides greater benefit), it's possible to leave something unfixed, but the rationale should be documented within the code.</li> </ul> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Mon, 31 Oct 2022 17:53:50 +0000 bnjmnm https://www.drupal.org/project/drupal/issues/3318394 Add a classloader that can handle class moves https://www.drupal.org/project/drupal/issues/3502882 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Sometimes we want to move a class from one place to a different place. An example is in <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/3502602" title="Status: Needs work">#3502602: Remove non-formatter plugins out of the file field formatter directory</a></span>.</p> <p>There are two solutions we've used in the past:</p> <p>1. Leave the old class in place, usually extending the new class, add @deprecated and trigger a deprecation. When we want to move something to avoid it being scanned for discovery, this does not help us until the next major release.</p> <p>2. Add a call to class_alias - this has to be manually specified in boostrap.inc and can never be removed.</p> <p>I think we might be able to handle both deprecation and aliasing in a classloader.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Something like:</p> <p>1. Create a new classloader</p> <p>2. This classloader allows a $movedClasses array to be populated via a setter.</p> <p>3. The moved classes array is keyed by the moved class, the value is an array of the new classname, the deprecated from version, the removed version (latter two could be optional).</p> <p>4. in DrupalKernel, register this as an extra classloader, it should run after the composer classloader so it has zero runtime overhead.</p> <p>5. When the composer classloader can't find a class, PHP falls back to our classloader. Our classloader checks the $movedClasses property, if the class is in there, it calls class_alias($old_class, $new_class, TRUE);</p> <p>If this works, we could then look at populating the moved classes array, potentially from a container parameter so that it's possible for core and contrib modules to add to it.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Tue, 28 Jan 2025 16:50:21 +0000 catch https://www.drupal.org/project/drupal/issues/3502882 Get nightwatch a11y test coverage to use Standard profile https://www.drupal.org/project/drupal/issues/3501493 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Given that Nightwatch has been udpated to include axecore in the work done in <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupalci/issues/2857808" title="Status: Active">#2857808: Automate Accessibility Checks for Core</a></span><br /> Resulting in: <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupalci/issues/2857808" title="Status: Active">#2857808: Automate Accessibility Checks for Core</a></span></p> <p>It would be good to continue to cover the rest of the pages highlighted in phase 1:<br /> <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupalci/issues/2857808" title="Status: Active">#2857808: Automate Accessibility Checks for Core</a></span></p> <p>This ticket is to change the test to use the standard installation profile to allow more pages to the covered.</p> <p>This will introduce the installation profile, but add bypasses to any tests that fail to allow the test to be added.</p> <p>As the issues are fixed we can remove the skip rules.</p> Wed, 22 Jan 2025 17:33:31 +0000 the_g_bomb https://www.drupal.org/project/drupal/issues/3501493 $query-&gt;addExpression and $query-&gt;orderBy in views Sql https://www.drupal.org/project/drupal/issues/2920153 <p>Currently the views SQL class 'core/modules/views/src/Plugin/views/query/Sql.php Sql' has limitations in the sense that all joins, order by, group by, expressions, etc must belong to a group or field.</p> <p>It would be nice to be able to have the same freedom when building/modifying queries as the Select class offers. (core/lib/Drupal/Core/Database/Query/Select.php Select)</p> <p>eg. there is currently no way to call "addExpression" via hook_views_query_alter.</p> <p>Yes we can call "addHavingExpression" or "addWhereExpression", however no way to add a select expression that is not related to a field.</p> <p>Something like this would do the trick</p> <pre class="codeblock"><code class="language-php">public function addCustomExpression($string, $alias){ $this-&gt;customExpressions[] = [ 'string' =&gt; $string, 'alias' =&gt; $alias ]; } </code></pre><p> Then when building the query, something like this</p> <pre class="codeblock"><code class="language-php">protected function compileFields($query) { if(count($this-&gt;customExpressions) &gt; 0){ foreach($this-&gt;customExpressions as $ex){ $query-&gt;addExpression($ex['string'], $ex['alias']); } } </code></pre><p> Then of course a programmer may wish to order by this field, so we'd need some sort of custom order by to order by the field. Perhaps something like the below</p> <pre class="codeblock"><code class="language-php">public function addCustomOrderBy($field, $direction){ $this-&gt;customOrderBys[] = [ 'field' =&gt; $field, 'direction' =&gt; $direction ]; } </code></pre><p> Then inside the 'compileFields' method.</p> <pre class="codeblock"><code class="language-php">if(count($this-&gt;customOrderBys) &gt; 0){ foreach($this-&gt;customOrderBys as $ob){ $query-&gt;orderBy($ob-&gt;field, $ob-&gt;direction); } } } </code></pre><p> I understand views is field based, however it would be nice to give developers the freedom to manipulate the sql to their choosing.</p> <p>Cheers.</p> Wed, 01 Nov 2017 05:46:57 +0000 Andrew211 https://www.drupal.org/project/drupal/issues/2920153 Migrate Feed Icon SDC component https://www.drupal.org/project/drupal/issues/3502353 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Drupal core currently lacks a reusable "Feed Icon" component,. This results in inconsistent styling and redundant implementations across the site. The creation of a standardized "Feed Icon" SDC will ensure design consistency, reusable code, and improved maintainability. This component will also enhance accessibility and will align with the design system for a cohesive user experience.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Sun, 26 Jan 2025 12:54:16 +0000 ignaciofarre https://www.drupal.org/project/drupal/issues/3502353 Convey AJAX progress messages to assistive technology. https://www.drupal.org/project/drupal/issues/2973140 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The AJAX API has a feature to display a progress message, but it isn't conveyed to assistive tech like screen readers.</p> <pre class="codeblock"><code class="language-php">'#ajax' =&gt; array( 'callback' =&gt; 'Drupal\config_translation\FormElement\DateFormat::ajaxSample', 'event' =&gt; 'keyup', 'progress' =&gt; array( 'type' =&gt; 'throbber', 'message' =&gt; t('Loading more products'), ), ),</code></pre><h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Find a way to convey the progress message.<br /> Possibilities (use one approach only, not both):</p> <ol> <li>Mark the visible AJAX message as an ARIA-live region (preferred?), or</li> <li>Duplicate the visible message using a Drupal.announce() call.</li> </ol> <p>Other possibilities might be to provide incrementally updated messages, like "Updating... 30%... 80%... finished".</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ul> <li>Perform manual testing</li> <li>Perform accessibility review</li> </ul> <h3 id="summary-ui-changes">User interface changes</h3> <p>No visual changes. Format the AJAX message so it is conveyed to assistive technology, e.g. so screen readers can announce it.</p> <h3 id="summary-api-changes">API changes</h3> <p>Several screenreader related properties have been added to the AJAX Progress settings.</p> <ul> <li><code class="language-php">announce</code> - Determines if screenreaders should announce progress for this operation</li> <li><code class="language-php">announceDelay</code> - The delay in milliseconds before the screenreader announces the progress</li> <li><code class="language-php">announceIntervalTime</code> - The interval in milliseconds between each announcement</li> <li><code class="language-php">announceMessage</code> - The message to be announced by the screenreader, if no <code class="language-php">message</code> property is set.</li> </ul> <h3 id="summary-data-model-changes">Data model changes</h3> <p>No data model changes introduced.</p> <h3>Background reading</h3> <ul> <li><a href="https://stackoverflow.com/questions/31716425/how-do-you-make-the-loading-icon-accessible-for-screen-readers-like-jaws" rel="nofollow">How do you make the Loading icon accessible for screen-readers like JAWS?</a></li> <li><a href="https://stackoverflow.com/questions/38518164/accessibility-page-loader-indicator-using-aria-live" rel="nofollow">Accessibility: Page Loader indicator using aria-live</a></li> <li><a href="https://events.drupal.org/nashville2018/sessions/javascript-and-accessibility-dont-blame-language" rel="nofollow">JavaScript and Accessibility: Don't Blame the Language (DrupalCon Nashville 2018 session)</a>. Recording and slides from Everett Zufelt's talk.</li> <li><a href="https://medium.com/myplanet-musings/javascript-and-accessibility-dont-blame-the-language-81ec189b163a" rel="nofollow">JavaScript and Accessibility: Don’t Blame the Language</a>, Everett Zufelt's article version on Medium.</li> <li><a href="https://www.slideshare.net/maxdesign/arialive-the-good-the-bad-and-the-ugly" rel="nofollow">aria-live: the good, the bad and the ugly </a>. Includes test notes about aria-live support as of 2015.</li> <li><a href="https://web.archive.org/web/20180317091742/http://maxdesign.com.au/jobs/sample-accessibility/10-notifications/index.html" rel="nofollow">Injecting content into the page tests</a>. The same test results from the previous slide deck.</li> <li><a href="https://dequeuniversity.com/library/aria/content-feedback/liveregion-playground" rel="nofollow">Live Region Playground</a>. A cool tool from Deque, useful for testing support on current browser/OS/AT combinations.</li> <li><a href="http://www.davidmacd.com/blog/test-aria-live-display-none.html" rel="nofollow">Testing ARIA-LIVE with display:none and innerHTML</a></li> <li><a href="https://terrillthompson.com/tests/aria/live-scores.html" rel="nofollow">ARIA Live Region Test</a>. Terrill Thompson's test page. Not sure what date, but it does have versions.</li> </ul> <h3>Commit credits</h3> <p>@bgrobertson, who reported this issue on the #accessibility channel on Drupal Slack, and researched which bits of the AJAX API were relevant. This issue report is a summary of his comments there.<br /> @ckueda, who provided a patch on the duplicate issue <span class="project-issue-issue-link project-issue-status-info project-issue-status-3"><a href="/project/drupal/issues/2907132" title="Status: Closed (duplicate)">#2907132: Indicate ajax throbber activity to assistive technology</a></span>, which is broadly similar to the earliest patch here.</p> Tue, 15 May 2018 20:39:51 +0000 andrewmacpherson https://www.drupal.org/project/drupal/issues/2973140 Deprecate comment_uri() https://www.drupal.org/project/drupal/issues/2010202 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Part of <span class="project-issue-issue-link project-issue-status-info project-issue-status-1"><a href="/project/drupal/issues/2010184" title="Status: Active">#2010184: [meta] convert ‘uri_callback’ entities param to EntityInterface::uri() method</a></span></p> <p><strong>Current state</strong>: the functions is not used after <span class="project-issue-issue-link project-issue-status-info project-issue-status-7"><a href="/comment/7517593#comment-7517593" title="Status: Closed (fixed), Assigned to: linclark">#1970360-78: Entities should define URI templates and standard links</a></span></p> <p>Needs to implement <code class="language-php">Plugin\Entity\Comment.php uri()</code> method and deprercate <code class="language-php">comment_uri()</code> function replacing it's calls to<code class="language-php"> $comment-&gt;uri()</code> and clean-up Comment annotation <code class="language-php">uri_callback</code></p> <p>1 usage in contrib found <a href="http://grep.xnddx.ru/search?text=comment_uri&amp;filename=" rel="nofollow">http://grep.xnddx.ru/search?text=comment_uri&amp;filename=</a></p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>- deprecate <code class="language-php">comment_uri()</code> in favor of <code class="language-php">Comment::toUrl()</code><br /> - probably it needs to update docs because <code class="language-php">Comment::permalink()</code> should be deprecated too <span class="project-issue-issue-link project-issue-status-info project-issue-status-13"><a href="/project/drupal/issues/2113323" title="Status: Needs work">#2113323: Rename Comment::permalink() to not be ambiguous with ::uri()</a></span></p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Investigate removal of uri_callback, <code class="language-php">git grep uri_callback</code> returns usages.</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>no</p> <h3 id="summary-api-changes">API changes</h3> <p>deprecated <code class="language-php">comment_uri()</code></p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>no</p> <h3 id="summary-release-notes">Release notes snippet</h3> <p>no</p> Sun, 02 Jun 2013 14:28:34 +0000 internetdevels https://www.drupal.org/project/drupal/issues/2010202 Document the return value expected by SelectionInterface::getReferenceableEntities() when used on an entity type with no bundles. https://www.drupal.org/project/drupal/issues/2863911 <h2>Issue description</h2> <p>The documentation in Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface::getReferenceableEntities() doesn't specify the expected first level key when used on an entity type that does not contain bundles:</p> <pre class="codeblock"><code class="language-php"> /** * Gets the list of referenceable entities. * * @return array * A nested array of entities, the first level is keyed by the * entity bundle, which contains an array of entity labels (escaped), * keyed by the entity ID. */ public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0); </code></pre><p> The expected first level key when no bundles are available is the entity type ID; example: 'role'.</p> <p>Without that first level entity type id key, any many other functions using this method will throw PHP notices etc; example: core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem::getSettableOptions().</p> <p>If this had been documented, I would have known that my implementation of getReferenceableEntities() for a custom entity type was incorrect rather than assuming getSettableOptions() was incorrect and writing a patch etc. Adding a note will likely save others time debugging the PHP notices from not returning the expected value in getReferenceableEntities().</p> <h2>Proposed text for @return documentation</h2> <blockquote><p>A nested array of entities, the first level is keyed by the entity bundle <em>(or the entity type ID if no bundles exist),</em> which contains an array of entity labels (escaped), keyed by the entity ID.</p></blockquote> Sat, 25 Mar 2017 00:02:28 +0000 jludwig https://www.drupal.org/project/drupal/issues/2863911 Add Date range filters for Moderate Content https://www.drupal.org/project/drupal/issues/3502540 <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The existing filtering options in the "Moderate" tabs are limited, making it difficult for users to find specific content efficiently. </p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>The filtering options in the "Moderate" tabs could really use an upgrade! Adding filters like a date range picker would be a game-changer, making it way easier to sort through and find content by specific time periods.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3 id="summary-ui-changes">User interface changes</h3> <h3 id="summary-introduced-terminology">Introduced terminology</h3> <h3 id="summary-api-changes">API changes</h3> <h3 id="summary-data-model-changes">Data model changes</h3> <h3 id="summary-release-notes">Release notes snippet</h3> Mon, 27 Jan 2025 13:26:17 +0000 anjaliprasannan https://www.drupal.org/project/drupal/issues/3502540 Introduce the concept of &quot;specificity&quot; for MENU_LOCAL_TASK and disallow &quot;duplicates&quot; https://www.drupal.org/project/drupal/issues/695324 <p>In a custom module I have a hook_menu implementation with the following entries:<br /> (adapted for better understanding. "xxx" was actually "mlid/%menu_link")</p> <pre class="codeblock"><code class="language-php">xxx : MENU_CALLBACK xxx/under-construction : MENU_DEFAULT_LOCAL_TASK xxx/add/page : MENU_LOCAL_TASK xxx/add/%node_type : MENU_LOCAL_TASK </code></pre><p> The intention:</p> <ol> <li>On xxx/under-construction, I want to see two tabs: The active one ("under construction") and the one for xxx/add/page. </li> <li>On xxx/add/page, I want to see two tabs: The active one ("add page") and "under construction". </li> <li>On xxx/add/webform, I want to see three tabs: xxx/under-construction, xxx/add/page, and xxx/add/webform. </li> </ol> <p>For 1) and 3) this works as intended, just for 2) I see a duplicate tab for "xxx/add/page". Obviously, the first is created for the router item "xxx/add/page", and the second one is for "xxx/add/%node_type".</p> <p>So, my thinking:<br /> - Yes, I am using the system in a legitimate way. Router items with different argument masks are allowed to coexist.<br /> - There is no point in having two tabs with the same link path. The more explicit router path (with fewer "%") should have priority, the other should be ignored.</p> <p>Technical obervation:<br /> The most important things happen in menu_local_tasks(), around this place:</p> <pre class="codeblock"><code class="language-php">&lt;?php while ($item = db_fetch_array($result)) { _menu_translate($item, $map, TRUE); if ($item['tab_parent']) { ?&gt;</code></pre><p>(my line numbers are probably incorrect due to some patching)</p> <p>I have not tried this with D7, so I set the version to 6.x-dev. Feel free to change this, if you can confirm it for D7 !</p> Tue, 26 Jan 2010 00:21:40 +0000 donquixote https://www.drupal.org/project/drupal/issues/695324 Cache backend consistency runtime check and graceful downgrade mecanism https://www.drupal.org/project/drupal/issues/1164484 <p>Hello,</p> <p>Cache backend management is a low-level critical functionallity, doing the <a href="http://drupal.org/project/cache_backport" rel="nofollow">Cache Backport</a> module, I also added some code improvements into the D6 backport.</p> <p>I think Drupal 7 could benefit those improvements, since they are API compatible and could avoid some crashes on misconfigured environments.</p> <p>Basically, I do all of this:</p> <ul> <li>Adding an interface for strongly environment related backends, backends that needs external libraries to run steamlessly should implement a new <code class="language-php">checkEnv()</code> method in order for core to test if the environment if ready.</li> <li>I added a dummy implementation of this method on the database backend, as a code sample.</li> <li>I added a <code class="language-php">class_exists()</code> call at cache backend instanciation time, if the current class does not exists, the backend gracefully downgrade to default.</li> <li>Added the necessary <code class="language-php">checkEnv()</code> calls while instanciating the backend class, and provide a graceful downgrade to default if it fails.</li> <li>Added a bonus Null Object implementation of cache backend; this allows site administrators or developers to disable fully cache for one or more bins by configuration.</li> </ul> <p>Using this interface improvements, it can be easy to implement administration screens (at least report screen) for various cache backends state, what I did in the D6 backport, and I could easily do for D7 if people are interested.</p> <p>Cache backend being plugins is now being discussed for D8, so that's why I won't do a D8 patch until the solution to this problem comes up, until, this can still provide a nice consistency bugfix for D7 next release.</p> Sat, 21 May 2011 12:01:00 +0000 pounard https://www.drupal.org/project/drupal/issues/1164484