Update drupal/coder from 8.3.1 to 8.3.5
Error message in installer mentions possibly wrong username, etc. but not port
In regards to http://drupal.org/node/82173, there should also be a notice for possible wrong port entered.
When Batch ID doesn't exist, Drupal should emit a 404
Problem/Motivation
Currently if you try to go to /batch?id=123 you get redirected to the homepage with a message stating "No active batch".
Beta phase evaluation
Issue category | Usability Bug, because the message "No active batch" is not clear, since no batch is ran and it does not exists. Response must help figure out what is going on actually. |
---|---|
Issue priority | Normal, because this is a self-contained bug and does not impact the overall functionality of the software. |
Unfrozen changes | Not unfrozen because it changes automated tests and needs a bug fix. |
Prioritized changes | Prioritized, the main goal of this issue is a bug fix, usability and user experience improvement. |
Disruption | Impact on improving usability is fair. Also it doesn't disrupt core API because it is internal to batch API only. |
Proposed resolution
Since the batch doesn't exist Drupal should just emit a 404 instead
User interface changes
Error message displayed, "The requested batch ({ID}) could not be found."
API changes
If you try to go to /batch?id=123 Drupal emit a 404.
Add cacheability to MediaLibraryState
Problem/Motivation
This issue is spun off from #3038254-60: Delegate media library access to the "thing" that opened the library.
The MediaLibraryState object is the crucial link in the way the Media Library system is stitched together. It is used for access checking, selection handling, and the construction of the Media Library UI itself. For all these reasons, it makes sense for it to be able to influence caching, but currently it does not carry any caching information.
Proposed resolution
Implement CacheableDependencyInterface, and its accompanying trait, on MediaLibraryState.
Remaining tasks
Do that.
User interface changes
None.
API changes
None, really.
Data model changes
None.
Release notes snippet
Probably none. This is a change to internal plumbing.
Move shutdown functions into the shutdown handler class.
Problem/Motivation
See #2999721: [META] Deprecate the legacy include files
Proposed resolution
Move functions into the shutdown handler class methods.
Remaining tasks
Deprecate shutdown functions
Convert functions into shutdown handler
Replace usages of the deprecated functions with the new shutdown handler calls.
User interface changes
-
API changes
-
Data model changes
-
Release notes snippet
-
Local tasks should honor selected admin interface language (if set)
Problem/Motivation
Local task labels are always displayed using the content language, ignoring that users can set their admin language preference (if the site has an admin language preference option set in negotiation). Local task label should honor this config and use the admin interface language. Even if they are in a non-admin pages, they are part of the admin interface.
This is very similar to what is being done in #2313309: Admin toolbar should always be rendered in the admin language (if set), but for local tasks. It's worth to note that in that issue current patches seems to translate Contextual Links as well (if not, probably a new issue should be created).
Proposed resolution
Render local task labels using the admin language config from language negotiation.
Remaining tasks
Implement it.
User interface changes
Local task labels will be in an admin-appropriate language. Optionally, a checkbox can be added to make this behavior optional.
API changes
Likely none.
Displaying the data from external database in Views Drupal 8
Good day, for Drupal 7 is a good example http://chrislarson.me/blog/drupal-and-external-mysql-database.html, as with hook_views_data, you can use Views to display data from a external database and table data. But in Drupal 8 everything was a little different
How can I achieve the same in Drupal 8
Want examples :(
p.s. External database non Drupal, database foreign for Drupal.
Views loaded with AjaxResponse will break ajax
I load a view in a controller with ajax, like this example:
$views_block = views_embed_view('example_views', 'block_1', $arguments);
$views_render = [
'#theme' => 'custom_template',
'#custom_view' => $views_block,
];
$render_root = $this->renderer->renderRoot($views_render);
$response = new AjaxResponse();
$selector = '#example-id';
$replace = new ReplaceCommand($selector, $render_root);
$response->addCommand($replace);
return $response;
So the user can click on a button on the website and the view appears with ajax. This is working great so far.
But the ajax pager of the view isn't working. The page reloads and shows the ajax replacement on a white screen. No JS errors...
I discovered that the view pager href has the controller path, instead of the current page relative path... I guess thats wrong.
Question: Is this a bug or what can I do?
Convert ImageEffectsTest & ToolkitTest into Kernel tests
Problem/Motivation
Part of the #1577902: [META] Remove all usages of drupal_static() & drupal_static_reset() effort for usages of drupal_static()
and drupal_static_reset()
in \Drupal\Tests\image\Functional\ImageEffectsTest
tests.
- Most of the methods from
ImageEffectsTest
are not doing any HTTP request. The exception is::testEffectFormValidationErrors()
but its scope could be tested with Kernel rather than Functional test. - No method from
ToolkitTest
is doing HTTP requests
.
Proposed resolution
- Convert
ImageEffectsTest
into a Kernel test. - Convert
ToolkitTest
into a Kernel test. - Deprecate
\Drupal\FunctionalTests\Image\ToolkitTestBase
. - Add a new trait
\Drupal\Tests\Traits\Core\ToolkitTestTrait
to provide reusable code.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Release notes snippet
N/A
Provide a Layout Overview dialog that allows performing all actions in a text/form based method
Problem/Motivation
From @andrewmacpherson's original extensive issue summary which can be seen here
We're in deeply experimental territory here - there isn't a well-established, reliable pattern we can just copy to make the current layout builder accessible. Essentially, we're making stuff up in a hurry, for a novel UI, with limited opportunity for design validation. There's no guarantee that users are going to understand it, or find it easy to use.
Proposed resolution
Provide a "Layout Overview"(better wording?) link at the top of the Layout Builder
This link would open up an overview in the off-canvas dialog that would allow the user to perform all the operations they can in the current live preview version.
All of the actions currently in the Layout Builder are performed in the off-canvas dialog either through selecting items in a list(adding blocks and sections) or interacting with a form. The only exception to this is dragging and dropping blocks but #2995689: Allow reordering blocks without a pointer device would provide a way to do this via a form.
The overview in the off-canvas would allow all users to share most of the UI's for taking actions on the Layout but provide a more standard way to access those actions than the current live preview.
After each action the users take via the overview they be would shown the overview again at the end of the action. This would allow a user to take multiple actions via the overview without having to open the overview for each action.
Remaining tasks
User interface changes
A new layout overview in the off-canvas dialog
API changes
None
Data model changes
None
Release notes snippet
@todo
Update mentoring coordinators section of MAINTAINERS.txt
Problem/Motivation
It has been another year since the last review of mentoring coordinators section of MAINTAINERS.txt by #2900394: Update mentoring coordinators section of MAINTAINERS.txt. Since this review, some people have defacto stepped down, and some have stepped up to lead the mentoring efforts.
Proposed resolution
1. Ask all people currently listed as core mentoring coordinators:
- Mauricio Dinarte 'dinarcon'https://www.drupal.org/u/dinarcon
- Lucas Hedding 'heddn'https://www.drupal.org/u/heddn
- Tara King 'sparklingrobots'https://www.drupal.org/u/sparklingrobots
- Rachel Lawson 'rachel_norfolk'https://www.drupal.org/u/rachel_norfolk
- Valery Lourie 'valthebald'https://www.drupal.org/u/valthebald
- Elli Ludwigson 'ekl1773'https://www.drupal.org/u/ekl1773
- Jess Myrbo 'xjm'https://www.drupal.org/u/xjm
- Matthew Radcliffe 'mradcliffe'https://www.drupal.org/u/mradcliffe
Maintainers should consult the definition of a maintainer in MAINTAINERS.txt and copied here for reference:
Mentoring coordinators recruit and coach other mentors. They work on contributor tools, documentation, and processes to make it easier for new contributors to get involved. They organize communications and logistics, and actively participate in mentoring.
2. Move people who have stepped down, to the past maintainers page
3. Remove people who have stepped down from MAINTAINERS.txt
4. Add new de-facto coordinators: (suggestions welcome)
- AmyJune Hineline 'volkswagenchick'https://www.drupal.org/u/volkswagenchick
- Brian Gilbert 'realityloop'https://www.drupal.org/u/realityloop
- Balazs Janos Tatar 'tatarbj'https://www.drupal.org/u/tatarbj
Remaining tasks
- Ask current maintainers what is their actual status with the core mentoring program
- Create patch
- Update past maintainers page
Response from the current maintainers
- Mauricio Dinarte 'dinarcon'https://www.drupal.org/u/dinarcon - step down, move to past maintainers
- Lucas Hedding 'heddn'https://www.drupal.org/u/heddn - step down, move to past maintainers
- Tara King 'sparklingrobots'https://www.drupal.org/u/sparklingrobots - stay
- Rachel Lawson 'rachel_norfolk'https://www.drupal.org/u/rachel_norfolk - stay
- Valery Lourie 'valthebald'https://www.drupal.org/u/valthebald - step down, move to past maintainers
- Elli Ludwigson 'ekl1773'https://www.drupal.org/u/ekl1773 - stay
- Jess Myrbo 'xjm'https://www.drupal.org/u/xjm - stay
- Matthew Radcliffe 'mradcliffe'https://www.drupal.org/u/mradcliffe - stay
User interface changes
None
API changes
None
Data model changes
None
Off-canvas styling for autocomplete search results make them difficult to read
Autocomplete search results in an off-canvas form (like a custom block in layout builder) are nearly impossible to read:
Steps to reproduce:
- Install site on 8.6.x or 8.7.x with standard install profile
- Enable layout builder module
- Add several terms to the existing "Tags" vocabulary
- Add a custom block type with a term reference field to the tags vocab
- Enable layout builder for the existing "Basic Page" content type
- Edit layout, and add your custom block to the page
- Search for terms in the autocomplete field, and observe that the results list displays dark gray text on a slightly darker gray background
The reason it happens is a combination of these two rules:
off-canvas.base.css has this:
#drupal-off-canvas *, #drupal-off-canvas *:not(div) {
background: #444;
font-family: "Lucida Grande", "Lucida Sans Unicode", "liberation sans", sans-serif;
color: #ddd;
}
That sets the background of the autocomplete <li> to that dark color.
Then we have this in off-canvas.form.css:
#drupal-off-canvas .ui-autocomplete li a {
color: #595959 !important;
cursor: pointer;
padding: 5px;
}
Which sets the links to that dark gray.
Multi-select list items "escape" bounding box in off-canvas tray in Chrome
We're using Layout Builder to allow editors to add custom blocks to a page. One of our custom blocks has a multi-value term reference field on it, with the form widget rendered as a combobox (multi-select). In Chrome, the list items "escape" the bounding box and overflow vertically.
Screenshot of what it should look like (Seen in Safari/Firefox/Edge):
Here's what it actually looks like in Chrome:
Steps to reproduce:
- Install fresh site from 8.6.x or 8.7.x and use "Standard" profile
- Enable Layout Builder
- Add at least 5 terms to the existing "Tags" vocabulary
- Add a custom block type and add a term reference field to the tags vocabulary. Allow unlimited items
- Update form display widget for that block type to use a select list
- Enable layout builder for the existing "Basic Page" content type default entity view display
- Edit layout, add block, and select "Add Custom Block"
- Add the new block you created, and observe the issue
This seems to be related to the "-webkit-appearance: menulist;" CSS property that's added in off-canvas.form.css. Once I removed that, it looks like it does in FireFox and Safari.
Concurrent editing of layouts is very confusing
Problem/Motivation
If two users attempt to edit the same layout, they will both see the changes the other is making.
Proposed resolution
Mimic the Views UI (which also uses tempstore.shared
) and lock the Layout Builder UI when another user is editing the layout.
Remaining tasks
N/A
User interface changes
The LB UI will now show a message when there is a lock of another user. Breaking the lock will bring you back to the LB UI to make your own changes.
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
[ignore] bnjmnm patch testing
(test this one instead)
View result counter shows {{counter}} placeholder when using "data_field" row plugin
Steps to reproduce:
1. Create a view
2. Add a "REST export" display
3. Select Format = Serializer and Show = Fields
4. Add a "Global: View result counter" field
When you check view results you will see counter field's value as {{ counter }}
Proposed solution:
Use render and postRender functions instead of advancedRender at https://git.drupalcode.org/project/drupal/blob/8.8.x/core/modules/rest/s...
This will allow for uncacheable fields in row level to replace placeholder by the correct value as described in
https://git.drupalcode.org/project/drupal/blob/8.8.x/core/modules/views/...
Add render_cache debug output
Problem/Motivation
Render Caching is great, but debugging asset / library adding and post_render cache can be really complicated, also it is difficult to see if there are cache hits or not.
In Drupal 7 render_cache module, I use twig style debug output, which works great.
Reference: https://github.com/LionsAd/render_cache/blob/770c615f6081e7d415dcae431ee...
Proposed resolution
In drupal_render_cache_get() (soon in renderer service) add something like (pseudo-code):
// _after_ get from cache
if ($this->use_debug) {
$elements = $this->addDebugOutput($elements, TRUE); // TRUE == Cache Hit
}
// _after_ set to cache
if ($this->use_debug) {
$elements = $this->addDebugOutput($elements, FALSE); // TRUE == Cache Miss
}
function addDebugOutput($elements, $cache_hit) {
$prefix = '<!-- START RENDER (#pre_render): ' . print_r($elements['#pre_render'], TRUE) . "\n" . ' CACHE INFO: ' . "\n" . print_r($elements['#cache'], TRUE);
$prefix .= "\nCACHE-HIT: " . $cache_hit ? 'YES' : 'NO' . "\n";
$prefix .= "\nATTACHED: " . print_r($elements['#attached'], TRUE) . "\n";
$prefix .= '-->';
$suffix = '<!-- END RENDER: ' . print_r($elements['#pre_render'], TRUE) . ' -->';
$elements['#markup'] = "\n$prefix\n" . $elements['#markup'] . "\n$suffix\n";
return $elements;
}
This is major, because it is almost impossible to debug render caching else. (I tried other ways ...)
The impact is minimal as when the option is turned off, there is no change in code.
Remaining tasks
- Make a patch!
User interface changes
- None
API changes
- New config option in services.yml to add render cache debug output.
Allow greater flexibility within Section::toRenderArray()
Problem/Motivation
In #2942661: Sections should have third-party settings, Section
objects were given third-party settings so that contrib could put some data on Sections, presumably to modify how they work.
However, if a contrib module wanted to change how the section was rendered (for example, modifying the regions before they were passed to the layout, ala region styles), it wouldn't be able because there is no event or alter hook in Section::toRenderArray()
in order to do so.
Also, it would make sense to have such an event, because in #2937799: Allow greater flexibility within SectionComponent::toRenderArray() a similar event is being called in SectionComponent::toRenderArray()
.
Proposed resolution
Call an event in Section::toRenderArray()
allowing contrib modules to modify the $regions
array before it's passed to $layout->build()
.
Remaining tasks
- Write a patch :-)
User interface changes
None.
API changes
A new event - details to be determined.
Data model changes
None.
Release notes snippet
Todo.
Consider supporting Layout Builder Overrides for other view modes
Problem/Motivation
#2905922: Implementation issue for Layout Builder only supports customizing the Full/Default view mode.
For overrides, the Layout Builder UI attaches itself to the canonical
route.
By default, there are no routes to view an entity in another view mode.
Additionally, for view modes like teaser
, the entity is shown in a way that might have wrapping markup/styling that would not be present if displayed individually
Proposed resolution
Devise a mechanism for displaying alternate view modes.
Possibilities:
- Individual routes per mode, like
/node/5/layout/teaser
- Dropdown to change the view mode being configured from
/node/5/layout
- ?
Try to mitigate issues around lack of styling (like a listing of teasers)
Remaining tasks
Decide on an approach
Write a lot of tests
User interface changes
One way or another, yes
API changes
TBD?
Data model changes
TBD?!
Unable to change the author of content using views/action
I want to change the author of multiple nodes using the action module. I have set up a new action by going to /admin/config/system/actions and then selecting "CREATE AN ADVANCED ACTION" and then "Change the author of content...".
In my view of the content type, I have added the "Node operations bulk form" field.
When I try to update any content using this method I get the error "No access to execute Change the author on the Content [TITLE]'. It happens when a content belongs to the anonymous user.
I have looked at the code that generates this error - it is in AssignOwnerNode.php
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
/** @var \Drupal\node\NodeInterface $object */
$result = $object->access('update', $account, TRUE)
->andIf($object->getOwner()->access('edit', $account, TRUE));
return $return_as_object ? $result : $result->isAllowed();
}
Not sure, why do we need to check permissions to edit the owner to change the owner of the node.
If I delete an inappropriate piece of code, it works. this is the new code:
/**
* {@inheritdoc}
*/
public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
/** @var \Drupal\node\NodeInterface $object */
$result = $object->access('update', $account, TRUE);
return $return_as_object ? $result : $result->isAllowed();
}