Problem/Motivation
There are no PHPUnit tests for the config class
Remaining tasks
Create PHPUnit tests to check that the config class is working as expected
There are no PHPUnit tests for the config class
Create PHPUnit tests to check that the config class is working as expected
Updated: Comment #0
Entity rendering got a lot slower in Drupal 8 (citation/numbers needed). That's why we worked very hard on #1605290: Enable entity render caching with cache tag support. That issue solved the problem for most entity types… but not for the most commonly used entity type of all: nodes.
Render caching for nodes is blocked on:
Many of these only became fixable after #2118703: Introduce #post_render_cache callback to allow for personalization without breaking the render cache landed a few weeks ago. We're almost at the point where can finally enable node render caching :) That will happen here!
Enable node render caching once all blockers have been fixed.
Fix all blockers.
None.
None.
The patch in #2021779: Decouple shortcuts from menu links started a looong time ago and it was the reason for introducing ControllerBase/FormBase IIRC, but the patch wasn't updated to make use of the new shiny. Let's do it here.
Discovered via #2175459: Convert Drupal\system\Tests\InstallerTest into a new Drupal\simpletest\InstallerTestBase
InstallerTranslationTest
is supposed to fail with this patch, because it does not define any test* methods, and thus, the test is not actually executed.
Hopefully that's the only test.
#2201783: Simplify execution logic in TestBase::run() should be committed first.
Entities tend to get serialized in various places : cache, forms...
ConfigEntities, being more business oriented, additionally tend to get more business specific helper methods, possibly relying on internal properties / derived data / external services, other than their raw data, and which you usually don't want to serialize.
Nice thing is, ConfigEntities have a pretty straightforward serialization format: the exported properties that end up in their CMI file...
We had to do this for Field / FieldInstance entities, that fall exactly in this case above, but the code is pretty agnostic and might make sense for all ConfigEntity types.
(since then, #2205367: [HEAD BROKEN] PHP 5.4 duplicated that same code in EntityFormDisplay - leaving the symmetrical EntityViewDisplay out).
Basically, serialize to the raw array returned by getExportProperties() (as if it was going to CMI), and unserialize by passing this array to __construct() (just as if it was read from config). Same format, different storage.
Patch once I get a node id.
Convert the following theme functions to use the new table #type:
Module | Theme function name | Where in Code | What is it really? |
---|---|---|---|
simpletest | theme_simpletest_test_table | function | table |
Spin-off from #1411074: Setup test environment only once per test class; introduce setUpBeforeClass() and tearDownAfterClass() [PHPUnit]
TestBase::run()
contains some unnecessary layers of control structure nesting, which make it hard to change the execution flow.
Attached patch performs no functional changes, and only removes the nesting:
Currently, theme_fieldset() uses empty() to determine whether or not to display a title for the fieldset. This means that #title's such as a zero will not be displayed. The attached patch converts #title to a string and displays the title unless the string is the empty string.
If a module has a configuration file (either simple config or config entity) that already exists in the active configuration it will not import. The current code just moves on see https://api.drupal.org/api/drupal/core!includes!config.inc/function/conf... especially
foreach ($config_to_install as $name) {
// Only import new config.
if ($target_storage->exists($name)) {
continue;
}
//...
One issue is that we have different situations where this can occur and we might want to do different things in each - which will almost be impossible.
I'd argue that in scenario 1 we'd want to prevent forum from being installed and in scenario 3 we're want to prevent module B from being installed. But we also have specific tests around forum node type preservation after disabling the forum module!
This issue was created as a result of @yched's comment https://drupal.org/comment/8196065#comment-8196065
Current patch produces a warning to the user that default config contained by the module failed to be created.
However I think we might need to go further and add a validation step prior to installing modules, themes and profiles to ensure that there is no default configuration clash.
Decide on how to resolve.
Potentially a new warning message.
Potentially a new way in module installation can fail.
This issue has novice tasks. If you are an experienced core developer and have multiple commit mentions, please review novices' work on these tasks rather than doing them yourself. Feedback from experienced contributors is valued.
Updated: Comment #0
There are two 'name' case's in comment_tokens() in core/modules/comment/comment.tokens.inc
remove the first - since the second is better because getAuthorName() does the anonymous stuff
No.
No.
There's an inconsistency on the front page of newly installed Drupal 8 sites. A link appears twice with different texts: "Add new content" and "Add content" (see graphic). A search through core shows that this inconsistency appears in several other places as well.
I propose making it consistent throughout core. My preference is for "Add content" because it's shorter and the word "new" is unnecessary.
A patch follows.
In #2002914: Rename Views method get_field_value() to getFieldValue() the access for getFieldValue was changed to protected (in addition to the rename). Quote from that issue:
Add protected access modifier in front of the function to adher to the new OOP standards.
I wonder why exactly? The function getField (which returns the rendered fields) is public. In a module I maintain (Views Send) I need access to both the rendered and raw fields.
If there is some unknown reason for keeping getFieldValue protected, I would like to know what the preferred work-around is.
PS! Very grateful for the work all of you do in making Drupal 8 happen.
Updated: Comment #0
Steps:
1) visit admin/structure/display-modes/form
- only User is listed
2) manually enter admin/structure/display-modes/form/add/node
- now you can add new form mode for Node
3) the same applies for view modes admin/structure/display-modes/view
Create a local action for admin/structure/display-modes/[form|view]/add
route that already works but not accesible from UI
Optinally we could get rid of links under each entity
create patch and write tests
New local action
no
As discussed in #1921152: META: Start providing tour tips for other core modules. we should add a block that shows the Available Tours. Availability depends on whether the module they belong to is enabled.
This block should be added by default to the main help page (admin/help). This screenshot visualizes what this should look like:
Create Available Tours block
- create block. Some work on this was already done in https://drupal.org/comment/7964451#comment-7964451
- create test
- enable block by default (in standard profile?)
- the main help page (admin/help) will be affected
No api changes
Entity access checks are not performed when executing a bulk operation from entity overview pages, such as the content overview page (admin/content) or the user overview page (admin/people).
hook_user_access()
in a custom module and deny delete access on any user entity (see code example below).$entity->access('delete')
will return FALSE
for user 3.The steps to reproduce for nodes are similar, though if the user does not have the permission "administer nodes", access to admin/content/node/delete is denied even if the user is allowed to delete the selected node.
hook_user_access()
<?php
/**
* Implements hook_ENTITY_TYPE_access() for entity type "user".
*/
function mymodule_user_access($entity, $operation, $account) {
if ($operation == 'delete') {
return FALSE;
}
}
?>
When I was searching for existing issues, I found issues about bulk operations being incomplete, though I didn't saw it mention entity access checks:
This issue/patch advances on #2185559: Extension System, Part I: SystemListing clean-up + performance; remove SystemListingInfo + drupal_system_listing()— we either skip that issue and directly go with this, or this patch can be easily rebased against 8.x with that patch.
Part I + II of #2186491: [meta] D8 Extension System: Discovery/Listing/Info
SystemListingInfo::scan()
triggers an infinite recursion to itself when scanning for installation profiles, because it tries to retrieve the profile directories to be scanned, which makes no sense.drupal_get_filename()
, which causes the first of call to drupal_get_path()
from other code to trigger yet another filesystem scan.SystemListing
are not cached, even though a subsequent scan will yield the identical results.InfoParser
are not cached, even though a subsequent info file parsing will yield the identical results.hook_system_theme_info()
only exists to allow modules to ship with test themes, whereas discovering themes is and should be the sole responsibility of the extension discovery process.Replace SystemListing[Info]
with a highly performance-optimized ExtensionDiscovery
:
Bench: 10 scans for 'modules'
SystemListing (HEAD): 6.825 seconds
ExtensionDiscovery: 0.391 seconds
.info.yml
files for all extension types./sites/all
) for the requested extension type only, scan it once for all extensions (of all types).'tests'
directories at regular runtime (~400% performance increase on its own).Extension
objects for all discovered extensions.→ Substantial extension discovery performance increase. Installer responds like a breeze.
drupal_get_filename()
after scanning for installation profiles to resolve the infinite recursion problem.InfoParser
results to prevent the same info files from being re-parsed again.drupal_system_listing()
with ExtensionDiscovery
.All Drupal extension types (profiles, modules, themes, and also theme engines) have to supply an .info.yml
file in order to be discovered.
'type'
, 'core'
, and 'name'
properties.'type'
value for theme engines is theme_engine
.'type'
property should ideally be declared first (for file parsing performance reasons only).Example:
type: theme_engine
name: Twig
core: 8.x
version: VERSION
package: Core
drupal_system_listing()
has been replaced with Drupal\Core\Extension\ExtensionDiscovery
.
<?php
$available_modules = drupal_system_listing('/^'. DRUPAL_PHP_FUNCTION_PATTERN . '\.module$/', 'modules');
?>
<?php
$listing = new ExtensionDiscovery();
$available_modules = $listing->scan('module');
// Note that the returned entries are Extension objects, offering access to
// SplFileInfo of the .info.yml file.
// @see http://php.net/manual/class.splfileinfo.php
// For example:
$filemtime = $available_modules['node']->getMTime();
?>
hook_system_theme_info() has been removed. Additional (test) themes provided by modules are discovered natively now.
(8.x-only) SystemListing
and SystemListingInfo
have been removed.
/sites/all
, duplicates top-level directories.ExtensionDiscovery
, obsolete with Migrate in core?'type'
properties in .info.yml
files to be defined first for performance (lead by example).The basic auth module allows brute-force login attacks.
(This is a security issue in the new basic_auth
module of Drupal 8, so it is critical by definition.)
Updated: Comment #N
user_authenticate could do with an OO revamp.
Do it
Do it
None
Maybe remove user_authenticate()
Part of #2068325: [META] Convert entity SQL queries to the Entity Query API. See the parent issue for details.
Updated: Comment #42
IntegerItem's currently have no way to denote that they are unsigned. For certain fields, however, it makes sense to provide validation that they are unsigned and to reflect this in the field's schema.
Add an 'unsigned' setting to IntegerItem.
Make tests pass.
None.
The following fields are now validated to be positive using the type data validation system and the database schema: