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

Convert pager.inc to a service

$
0
0

I do not know how this would fit in the timeline :( but looking at pager.inc overall I thought it may be worth to build a component for the helper functions and to move the pager theme preprocessing to theme.inc.

I will post a first stab - a patch that eventually removes pager.inc and 4 global variables; also, makes a bit more readable the routine that prepares the 'page' querystring fragment.

I have incorporated parts of #1588138: pager_query_add_page() [in D7, theme_pager_link()] overrides parameters passed programmatically in this patch.

Of course more polishing would be needed, but before all I'd like to get feedback: is this a path that make sense to follow?


Back to site links to wrong path in case the last path visited is 404 page

$
0
0

Problem Motivation

Back to site links to wrong path in case the last path visited in *Page not found* page.

Steps to reproduce

  • Login as an admin
  • Visit any page which does not exist: For example: admin/config/not-found
  • Click on any link in the toolbar and randomly hit multiple links in the toolbar
  • Check the path of *Back to site*, it points to

    Proposed resolution

Proposed resolution

The bug has been introduced by core/modules/toolbar/js/escapeAdmin.js file which needs to be fixed.

Remaining Tasks

  • Write patch
  • Test, test and test

API Changes

None

Inline file_uri_scheme() in file_stream_wrapper_uri_normalize() and other file.inc functions

$
0
0

Why this should be an RC target

file_uri_scheme has been deprecated in D8, the rtbc patch 11 cleans up the deprecated calls and replaces them with the correct calls to use the new service class uriScheme()

Function usually doesn't run on a normal page load.
Cache flush:

file_stream_wrapper_uri_normalize()
Before:
Total Self: 151ms
Total Cumulative: 343ms
Calls: 21,872

After:
Total Self: 163ms
Total Cumulative: 193ms
Calls: 21,872

Total savings ~150ms.

"Source path ... has to start with a slash" exception when using contextual filter

$
0
0

Problem/Motivation

Selecting 'Use path alias' in contextual filter results in an exception. Problem originates from a recent change: #2509300: Path alias UI allows node/1 and /node/1 as system path then fatals

Steps to reproduce:

  1. Add a new view (default settings)
  2. Add contextual filter 'Content: Node ID' - Settings:
    • Default actions : Provide default value
    • Type : Raw value from URL
    • Use path alias : checked
  3. Click "Apply"

Results in the following:

Uncaught PHP Exception InvalidArgumentException: "Source path admin/structure/views/view/articles/preview/rest_export_1 has to start with a slash." at c:\...\www\...\core\lib\Drupal\Core\Path\AliasManager.php line 194

Saving the view while the filter is present will also produce the error.

Proposed resolution

Change trim() to rtrim() in Raw::getArgument (default argument plugin).

Will require some refactoring to keep the path component index syncing up with the proper arguments.

Add new test that checks for NULL or nonexistent path arguments.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

File extension + max_filesize should be validated using a Constraint on file fields

$
0
0

Problem/Motivation

See #2587957: [meta] Arbitrary files can be referenced in POST request, access bypass

@yched :
- The 'file_extensions' and 'max_filesize' restrictions are currently only ever applied by the field widgets, in the shape of validation routines passed as the '#upload_validators' property of the underlying ManagedFile FAPI element (more precisely, ManagedFile::valueCallback() delegates to an old-school function, file_managed_file_save_upload()).
- And those are checked only on *new uploads*, which explains that you can forge fake form values referencing an existing fid, and bypass the checks completely.

So yeah, the bug is probably two-fold :

- At the FAPI level (ManagedFile element), maybe the constraints should be enforced not only on file uploads, but checked on any submitted fid. That can be argued, I guess, since the property is named '#upload_validators', so we can't really say it's lying, it never claimed doing more than checking uploads :-)

- At the entity level, there should definitely be constraints that ensure validation fails if a field references a file that is not eligible according to the field settings, independantly of whether the widget / form element catches them or not (which it currently doesn't, as per the above). Those validations would fix REST, and make sure our entity forms have no holes either.

Then it's the usual problem of "it's better if the widget doesn't spend too much time validating, since the work will be done by entity validation anyway". The way this was approached in the EntityRef "autocomplete" widget and the underlying EntityAutocomplete FAPI element, is that the element has a #validate_reference flag, that defaults to TRUE, but that the widget sets to FALSE knowing that validation will be performed at the entity level.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Let entity_ref Selection handlers be in charge of the field validation

$
0
0

Spin-off from #2064191: Fix the 'target_bundle' field setting - 'target_bundles' are not validated when entity_reference is enabled

Problem/Motivation

The "selection handler" plugins are in charge of defining which entities can be referenced by an e_r field. However, they don't take part in the validation of entity_ref fields :
- ERItem::getConstraints() only hardcodes a check against the list of referenceable bundles, if the field uses the default "selection handler" plugin. That was added as a quickfix in #2064191: Fix the 'target_bundle' field setting - 'target_bundles' are not validated when entity_reference is enabled.
- Other selection handlers are left out of the validation process entirely. That includes ViewsSelector, which lets you define referenceable entities using a View, or even the various NodeSelector, UserSelector, that extend the default "by bundle" SelectorBase by refining the logic a bit (e.g "can't reference an unpublished node")

What is affected :
- REST operations
- The "options" widget are immune by design (they only let you select valid options), but they are seldom used (unusable with 20+ referenceable entities)
- The autocomplete widget is affected : it doesn't call the Selection plugin's validateReferenceableEntities(), because it uses the EntityAutocomplete FAPI element with #validate_reference = FALSE, which is correct for a widget (leave the real data validation to data-level constraints, to avoid doing the work twice), except the ValidReference constraint will do it (which it doesn't atm).
Meaning, the autocompletion list only shows valid options, but the user can manually type "whatever (42)", with 42 being the ID of any entity of the target type, and no error will be reported (other than the 'invalid bundle' violation caught by our hardcoded Bundle constraint). Any other restriction imposed by the Selection plugin is ignored .
- Other (contrib/custom) widgets can be affected as well, depending on their implementation.

Proposed resolution

It should be the selection handler plugins that define what is checked during validation, since they are the ones that already contain the logic for "what is referenceable for this field".

In #2064191: Fix the 'target_bundle' field setting - 'target_bundles' are not validated when entity_reference is enabled, it was considered to repurpose the existing ValidReference constraint to operate on the FieldItemList level (rather than Item-by-Item, which is a perf drag), and have its validator :
- collect the target_ids across each Item, call the *existing* $selector_plugin->validateReferenceableEntities($ids), and flag a violation on each delta whose target_id is deemed invalid
- collect the fresh ("autosaved") entities across each item, call a *new* $selector_plugin->validateNewEntities($entities) method (name TBD), and flag a violation on each delta whose entity is deemed invalid

As a side note : ViewsSelector is inherently incompatible with "autosave". You cannot validate that an $entity that isn't in the database yet will match a given View. How fun :-) That would probably need taking into account for the field config UI in #2412569: Target bundle for auto-created entity references with multiple target bundles. For the validation issue here, I guess ViewsSelector::isEntityValid() would just say "no / not supported" for unsaved entities.

Remaining tasks

- Decide/refine on the new SelectorInterface::validateNewEntities($entities)
- Fix tests

API changes

A new method would be needed on SelectorInterface to validate entities that are not in the db yet.

Breadcrumb should be term name instead of term id on term edit and delete page

$
0
0

Problem/Motivation

Breadcrumbs for taxonomy pages currently show term ids instead of term names.

Proposed resolution

Make Breadcrumbs for taxonomy pages show term names instead of term ids.

Remaining tasks

  • write a fix for bug.

User interface changes

none

API changes

none

Data model changes

none

It's showing term id in breadcrumb instead of term name.

Before applying patch

Before patch

After applying patch

After patch

Can't select granularity on date argument.

$
0
0

Problem/Motivation

In date module in d7 we had the Date argument (date_views_argument_handler_simple) which allowed you to set granularity and a date range on a date field or property.
It looked something like this:

I can't seem to find that specific argument anymore in views or datetime module, did this stay in contrib or is this a regression?

Proposed resolution

Discuss if this should be in core or not, if it should be add a new (generic) date argument.

Add three plugins to mirror the ones for Timestamp: week, date, and year+month.

Update text of existing plugins to match others, to reduce user confusion.

Remaining tasks

  • Add plugin classes + hook__field_views_data plumbing for week, date, and year+month
  • Add test coverage

Mark \Drupal\Core\Theme\Registry internal

$
0
0

Problem/Motivation

Overriding \Drupal\Core\Theme\Registry is dangerous because it could break many assumptions made in the theme system. Theme registry contents should be frozen but the way it's generated shouldn't. We should also be able to add features to Registry in minor releases and this isn't really possible right now because unknown places (custom/contrib/core themes and modules) trust the way it works. This logic shouldn't be overrideable (or we should tell people to not do it) because it's connected very tightly to the whole theme system.

Why this is RC eligible

This only changes documentation by marking a class internal.

Proposed resolution

Mark \Drupal\Core\Theme\Registry internal.

Remaining tasks

User interface changes

API changes

Data model changes

Views filter rearanging not working

$
0
0

Views filter rearranging is not working properly in case criteria are grouped.

Applying rearranging does not save new criteria arrangement into the database.

Starting arrangment:
Only local images are allowed.

Rearranged:
Only local images are allowed.

But the result is not saved into database:
Only local images are allowed.

It seems that only one modification is saved at once.

Only the last views argument token works

$
0
0

Problem/Motivation

The code in PluginBase::viewsTokenReplace() replaces $twig_tokens[$top] on every loop, if multiple tokens have the same $top, only the last actually ends up in the array.

Proposed resolution

Merge the tokens together instead of overwriting.

Remaining tasks

User interface changes

API changes

Data model changes

Why this should be an RC target

From #5:

Trivial fix with test coverage that really shouldn't break anything, so maybe we can get it in before 8.0.0?

Fatal error upgrading from RC1 to RC2: Cannot redeclare config_get_config_directory()

$
0
0

I tried to update drupal-8.0.0-rc1 to drupal-8.0.0-rc2. I download rc2 tarball, when I tried to access it via /core/install.php and got blank screen.

PHP Fatal error: Cannot redeclare config_get_config_directory() (previously declared in /X/drupal-8.0.0-rc1/core/includes/bootstrap.inc:151) in /X/drupal-8.0.0-rc2/core/includes/bootstrap.inc on line 143

What's off, is reference in location path, first one says drupal-8.0.0.rc1 and the other one is drupal-8.0.0-rc2.

Module install form has two "install" buttons that do different things

$
0
0

Problem/Motivation

The module install form (admin/modules) has two buttons that do different things:

  • Install new module downloads and installs a module
  • Install installs the modules that were selected on the form

At the top is:

In HEAD, the bottom link is:
before_134.png
But the consensus is to change it to:
after_139.png
This has confused at least a few people on this issue.

Proposed resolution

Rename the second button "Install selected modules".

Remaining tasks

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Embed before and after screenshots in the issue summary NoviceInstructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standardsInstructions

User interface changes

Yes, button rewording.

API changes

Data model changes

The "Member for" output for users must be marked uncacheable.

$
0
0

Problem/Motivation

  1. Install Drupal
  2. Visit /user/1 shortly thereafter. See that the output is Member for X minutes and Y seconds
  3. Wait a period that is longer than 1 second :-P
  4. Reload the page. See that the output is still unchanged, and has now become incorrect.

Proposed resolution

The easy solution is making user_user_view() add '#cache' => ['max-age' => 0] to its output. However, it seems that any output involving DateFormatterInterface::formatTimeDiffSince() (and DateFormatterInterface::formatTimeDiffUntil()) has this problem, so not sure if there is a more generic solution.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Add back the ability for install profiles (or at least distros) to pre-select a language or modify the language-selection screen

$
0
0

In Drupal 7, install profiles could implement the pseudo-hook hook_profile_details() to pre-select a language for the person installing Drupal. They could also allow the person installing to select a language, but use hook_install_tasks_alter() to modify the default core UI for doing so.

As a result of #1260716: Improve language onboarding user experience, this is no longer possible in Drupal 8. As discussed in that issue, this is the (major-priority) followup task for adding that back in some way.

There was some proposed code for keeping that feature in place in the above issue and elsewhere (see for example http://drupal.org/files/distro-settings.patch). That did not go in, primarily due to the feedback that it was too odd for the behavior of a hook to be influenced by a property in the profile's .info file.... So, we need to come up with a cleaner way of doing it. Perhaps a second hook instead, which determines the installation steps that are allowed to be altered by hook_install_tasks_alter()? And ideally, the only things that ever get passed in to hook_install_tasks_alter() should be the tasks that actually are able to be altered for real.


Incorrect syntax in frontend theme .info.yml file will throw an error in the backend when clearing caches via the UI

$
0
0

Unexpected error will show on admin interface if there is wrong syntax in custom theme used on frontend (frontend only theme can crash backend)

Path to reproduce:
- install D8 RC2
- create custom theme (working one - checked it to be ONLY FRONTEND THEME - no admin theme)
- add somewhere in line '/' to themename.info.yml (break something in syntax - i add / alone in new line)
- site working and backend working fine!
- clear cache!
- go to '/admin/config/development/performance' and see info about 'unexpected error occur' in admin panel.
- nothing work only if you:
- find bug and remove it.
- clear cache manually

Frontend isn't working because of error in syntax but... backend is dead and this where I see bug.

Option 1:
Fix this bug so theme for frontend can't prevent run admin theme.
Option 2:
Add more clearly info what going on?

This is my first time I write project issue summary. If something is wrong on it I will correct It.

Uncaught TypeError: Cannot set property 'float' of undefined when switching text formats

$
0
0

Follow-up to #2579979: Allow contrib to alter EditorImageDialog/EditorImageDialog and have custom attributes be stored

Problem/Motivation

From #2579979-27: Allow contrib to alter EditorImageDialog/EditorImageDialog and have custom attributes be stored:

I'm getting strange JS errors after this:

Uncaught TypeError: Cannot set property 'float' of undefined

Looks like styles is not initialized, but I have no idea what's different in my case that it only happens for me?

This for example happens when switching from an text format without drupalimage to one that has it enabled and completely breaks wysiwyg then.

The following fixes it for me, I can open a follow-up tomorrow, but I don't know enough JS to know if the problem is really somewhere else?

diff --git a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
index 724fa50..5160797 100644
--- a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
+++ b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
@@ -43,6 +43,7 @@
         });
         var allowedContentDefinition = {
           element: 'img',
+          styles: { },
           attributes: {
             '!data-entity-type': '',
             '!data-entity-uuid': ''

Proposed resolution

Fix it.

Remaining tasks

Write patch & review

User interface changes

None

API changes

None

#2061377: Allow image style/responsive image mapping to be selected in Text Editor's image dialog (necessary for structured content)
#2579979: Allow contrib to alter EditorImageDialog/EditorImageDialog and have custom attributes be stored

Install new module give AJAX error: 404 on /core/authorize.php/core/authorize.php

$
0
0

I'm surprised to find this in 8.0.0-rc1, and, not finding anything about it in the issue queue, I wonder if perhaps others are not seeing this, but in any event, I can not install modules through the admin page. 100% reproducible using the PHP built-in webserver (drush rs) and the Pantheon platform.

Steps to reproduce:

0. Install Drupal somehow, if its installed change to its directly goto step 3
1. drush qd --profile=standard --core=drupal-8 -y d8rc1test
2. cd d8rc1test/drupal-8
3. drush rs /
4. Log in
5. click on "Extend"
6. click on "+ Install new module"
7. Paste in any module link, e.g. http://ftp.drupal.org/files/projects/devel-8.x-1.x-dev.tar.gz

Result:

Route discoverability through twig debug

$
0
0

Problem/Motivation

For a themer and potentially others, route name discoverable would be preferable over paths and making routes easier is key to this.

Proposed resolution

When twig_debug is turned on (or other debug/development variable), inject the page's route into a comment in the page template.

Remaining tasks

Create a patch to inject the page's route if available when twig_debuging.

User interface changes

n/a

API changes

n/a

Followup: Add more tests for RSS feeds to the Comment and Aggregator modules

Viewing all 295646 articles
Browse latest View live


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