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

Get process plugin sets multiple for empty array

$
0
0

I have been scratching my head over this issue. The source sometimes has a blank offers, sometimes it is an array with data and sometimes it is an empty array - like this one:
https://api.hel.fi/linkedevents/v1/event/matko:16134/

With the latter example I was getting a bunch of Array index missing, extraction failed exceptions from the extract plugin, despite the skip_on_empty plugin running before, as you can see from my yml file:

  field_offers_is_free:
    -
      plugin: skip_on_empty
      method: process
      source: offers
    -
      plugin: extract
      index:
        - 0
        - is_free
  field_offers_info_url:
    -
      plugin: skip_on_empty
      method: process
      source: offers
    -
      plugin: extract
      default: false
      index:
        - 0
        - info_url
        - fi

I managed - in the end - to track down the reason for why our skip_on_empty plugin was never called: When Get sets $multiple to true, processRow in MigrateExecutable runs a foreach on the value - causing the whole skip_on_empty plugin to be skipped.

With this quick fix in modules/migrate/src/Plugin/migrate/process/Get.php's transform function things work fine for me:

    if (is_string($source)) {
      $a = is_array($return[0]);
      $b = !empty($return[0]);
      $this->multiple = $a && $b;
      return $return[0];
    }

Did I encounter a bug in Migrate or should I change my migration configuration?


Views current_page incorrect when out of range

$
0
0

Problem/Motivation

The current page count in views is incorrect when requesting a page that is past the page limit based on the number of items.

For example in a view the current page is handled as follows:
?page=0: current_page == 0 rendered as 'Page 1'
?page=1: current_page == 1 rendered as 'Page 2'
?page=2: current_page == 1 rendered as 'Page 2'
?page=3: current_page == 2 rendered as 'Page 3'

The behavior I would expect is that the current page increments sequentially from 0 in code and from 1 in the rendered output.

This is verified with the attached test SqlPagerBaseTest.php which currently fails.

Proposed Resolution

The problem appears to be here:

Drupal\views\Plugin\views\pager\SqlBase::updatePageInfo()

      // See if the requested page was within range:
      if ($this->current_page >= $pager_total[$this->options['id']]) {
        // Pages are numbered from 0 so if there are 10 pages, the last page is 9.
        $this->setCurrentPage($pager_total[$this->options['id']] - 1);
      }

Where the code is decrementing the current_page by one when out of range. However, the user-facing page count starting at 1 instead of 0 is already handled by the pager rendering. As far as I can tell this condition is not necessary and removing it causes this test case to succeed.

Perhaps there is some purpose for this that I'm not aware of but it does seem to be the culprit here.

unable to push configuration changes for Layout Builder

$
0
0

I am having a problem with Layout builder and pushing the configuration changes from dev to master branch on a

site we upgraded from 8.6.15 to 8.7.1

I was able to replicate it on a fresh instance.

The steps I followed were as follows:

1) Installed a fresh Drupal instance core 8.7.1
2) I enabled Layout Builder, Field Layout & Layout Discovery
3) with Devel I created Article & Basic Page content
4) I edited Manage Display for both content types:
a) Use Layout Builder was pre-selected
b) clicked Manage Layout
c) clicked Save Layout
d) I was put back into Manage Display then I selected "Allow each content item to have its layout customized"
e) clicked Save
f) clicked Manage Layout
g) clicked Save Layout
h) I was put back into Manage Display and I clicked Save
5) I then did a drush cex to export my configuration
6) committed my changes and pushed them to the master branch
7) on the master branch I verified my changes were there and then did my import.
8) all my changes were accepted except:
a) core.entity_view_display.node.page.teaser
b) core.entity_view_display.node.article.teaser
c) core.entity_view_display.node.article.rss

Generalize TaxonomyIndexTid filter to be available for all entity reference fields

$
0
0

Problem/Motivation

One major piece of functionality from the D7 Entity Reference module was left out entirely in #1801304: Add Entity reference field: the ability to render exposed views filters as a select list of available entities.

Proposed resolution

Generalize the taxonomy module's TaxonomyIndexTid plugin to be available for all entity reference fields.

Remaining tasks

User interface changes

The UI from D7 will be a good starting point:

API changes

TBD

Delegate media library access to the "thing" that opened the library

$
0
0

Problem/Motivation

From #2983179-16: [META] Implement stricter access checking for the media library:

Secondly, as @marcoscano points out, a permission might be too blunt of an instrument for controlling access to the media library, simply because it can potentially be used in a bunch of different places and in different ways. With a permission, a site builder would need to grant at least two permissions to authors in order to allow them to use the media library at all -- they'd need the "view media" permission, and permission to access the media reference field at all. That's a big fat DrupalWTF that we should do our best to avoid. Instead, we will implement some sort of system, probably based on the event system, to ask the opener (i.e., the field or the WYSIWYG editor in question) to allow or deny access to the media library, based on the parameters in the state object. Since the state object is central to computing access this way, we'll need the tamper-proofing in place first.

Proposed resolution

Implement some sort of system, probably based on the event system, to ask the opener (i.e., the field or the WYSIWYG editor in question) to allow or deny access to the media library, based on the parameters in the state object.

Remaining tasks

Write patch
Review
Commit

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

datetime date views filter: DateTime object not set

$
0
0

Problem/Motivation

Using datetime views filter and filtering with an invalid date, there is no validation and fatal error occured.

To reproduce:

  • Add a datetime field in an entity bundle.
  • Create a view to list this entities and add a filter on this datetime field
  • Search for a date with wrong format or for example day in french: lun 2018-04-27. The following error occur:
    <em class="placeholder">Exception</em>: DateTime object not set. in <em class="placeholder">Drupal\Component\Datetime\DateTimePlus-&gt;__call()</em> (line <em class="placeholder">355</em> of <em class="placeholder">core/lib/Drupal/Component/Datetime/DateTimePlus.php</em>). <pre class="backtrace">Drupal\datetime\Plugin\views\filter\Date-&gt;opSimple(&#039;sesame_quota_option__field_sesame_opt_date.field_sesame_opt_date_value&#039;) (Line: 314)
    Drupal\views\Plugin\views\filter\NumericFilter-&gt;query() (Line: 1370)
    Drupal\views\ViewExecutable-&gt;_build(&#039;filter&#039;) (Line: 1259)
    Drupal\views\ViewExecutable-&gt;build() (Line: 390)
    Drupal\views\Plugin\views\display\PathPluginBase-&gt;execute() (Line: 180)
    Drupal\views\Plugin\views\display\Page-&gt;execute() (Line: 1627)
    Drupal\views\ViewExecutable-&gt;executeDisplay(&#039;page_1&#039;, Array) (Line: 77)
    Drupal\views\Element\View::preRenderViewElement(Array)
    call_user_func(Array, Array) (Line: 378)
    Drupal\Core\Render\Renderer-&gt;doRender(Array, ) (Line: 195)
    Drupal\Core\Render\Renderer-&gt;render(Array, ) (Line: 226)
    Drupal\Core\Render\MainContent\HtmlRenderer-&gt;Drupal\Core\Render\MainContent\{closure}() (Line: 582)
    Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 227)
    Drupal\Core\Render\MainContent\HtmlRenderer-&gt;prepare(Array, Object, Object) (Line: 117)
    Drupal\Core\Render\MainContent\HtmlRenderer-&gt;renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber-&gt;onViewRenderArray(Object, &#039;kernel.view&#039;, Object) (Line: 76)
    Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher-&gt;dispatch(&#039;kernel.view&#039;, Object) (Line: 156)
    Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
    Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
    Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 38)
    Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
    Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 664)
    Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
  • Search for the same date with day in english works: mon 2018-04-27. Same for date only: 2018-04-27

Proposed resolution

Mimic the date filter validation from views module.

Remaining tasks

  1. Add tests
  2. Review

hosting effects: Serialization NormalizerBase.php

$
0
0

API page: https://api.drupal.org/api/drupal/core%21modules%21serialization%21src%2...

Enter a descriptive title (above) relating to NormalizerBase.php, then describe the problem you have found:

Not so much a problem to my uneducated mind. My hosting company sent me a notice "Input Validation vulnerability in Drupal
/.../core/modules/serialization/src/Normalizer/NormalizerBase.php". They patched the file with the attached file (I changed the file extension to txt). I have not noticed any affect, one way or the other.

Would this change be good to add to the current NormalizerBase.php? Will this affect how my Drupal install works? Would this be host specific? Is this a security issue?

Fatal error update 8702 createHandlerInstance invoked with NULL class object.

$
0
0

When trying to run database update while upgrading to drupal 8.7.1 from 8.6.15, I'm unable to apply the system update 8702.

drush updb

 ------------------- ----------------------------------------------- --------------- -----------------------------------------------------------------------------      
--
  Module              Update ID                                       Type            Description                                                               --      
 ------------------- ----------------------------------------------- --------------- ---------------------------------------------------------------------------
--
  system              8702                                            hook_update_n   Add the 'revision_translation_affected' entity key.
  comment             8701                                            hook_update_n   Make the 'entity_type' and 'field_name' comment fields required.
  file                8700                                            hook_update_n   Set the 'owner' entity key and update the field.
  media               8700                                            hook_update_n   Set the 'owner' entity key and update the field.
  node                8700                                            hook_update_n   Set the 'owner' entity key and update the field.
  taxonomy            8701                                            hook_update_n   Add an index on the 'taxonomy_term__parent' field table.
  comment             add_ip_address_setting                          post-update     Add comment settings.
  layout_discovery    recalculate_entity_form_display_dependencies    post-update     Recalculate dependencies for the entity_form_display entity.
  layout_discovery    recalculate_entity_view_display_dependencies    post-update     Recalculate dependencies for the entity_view_display entity.
  media               enable_standalone_url                           post-update     Keep media items viewable at media{id}.
  menu_link_content   make_menu_link_content_revisionable             post-update     Update custom menu links to be revisionable.                              4       
  system              add_expand_all_items_key_in_system_menu_block   post-update     Initialize 'expand_all_items' values to system_menu_block.
  system              clear_menu_cache                                post-update     Clear the menu cache.   @see https:www.drupal.orgprojectdrupalissues304436
4
  taxonomy            make_taxonomy_term_revisionable                 post-update     Update taxonomy terms to be revisionable.
  taxonomy            remove_hierarchy_from_vocabularies              post-update     Remove the 'hierarchy' property from vocabularies.                        --      
  views               exposed_filter_blocks_label_display             post-update     Update exposed filter blocks label display to be disabled.
  views               make_placeholders_translatable                  post-update     Rebuild cache to allow placeholder texts to be translatable.
 ------------------- ----------------------------------------------- --------------- ---------------------------------------------------------------------------
--

 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > yes 

 [notice] Update started: system_update_8702 
 [error]  Error: Class name must be a valid object or a string in Drupal\Core\Entity\EntityTypeManager->createHandlerInstance() (line 291 of /app/web/core/lib/D
rupal/Core/Entity/EntityTypeManager.php) #0 /app/web/core/lib/Drupal/Core/Entity/EntityTypeListener.php(89): Drupal\Core\Entity\EntityTypeManager->createHandler
Instance(NULL, Object(Drupal\Core\Entity\ContentEntityType))
#1 /app/web/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php(207): Drupal\Core\Entity\EntityTypeListener->onEntityTypeUpdate(Object(Drupal\Core\Ent
ity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType))
#2 /app/web/core/modules/system/system.install(2283): Drupal\Core\Entity\EntityDefinitionUpdateManager->updateEntityType(Object(Drupal\Core\Entity\ContentEntity
Type))
#3 /app/web/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(185): system_update_8702(Array)
#4 /app/web/vendor/drush/drush/includes/batch.inc(235): Drush\Commands\core\UpdateDBCommands->updateDoOne('system', 8702, Array, Object(DrushBatchContext))     
#5 /app/web/vendor/drush/drush/includes/batch.inc(183): _drush_batch_worker()
#6 /app/web/vendor/drush/drush/includes/batch.inc(95): _drush_batch_command('431')
#7 /app/web/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(142): drush_batch_command('431')
#8 [internal function]: Drush\Commands\core\UpdateDBCommands->process('431', Array)
#9 /app/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(235): call_user_func_array(Array, Array)
#10 /app/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Ob
ject(Consolidation\AnnotatedCommand\CommandData))
#11 /app/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(150): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, A
rray, Object(Consolidation\AnnotatedCommand\CommandData))
#12 /app/web/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(404): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Compo
nent\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 /app/web/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\LessStrictArgvInput)
, Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /app/web/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfo
ny\Component\Console\Output\ConsoleOutput))
#15 /app/web/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCom
mand), Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /app/web/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony
\Component\Console\Output\ConsoleOutput))
#17 /app/web/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfo
ny\Component\Console\Output\ConsoleOutput))
#18 /app/web/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#19 /app/web/vendor/drush/drush/drush.php(66): Drush\Runtime\Runtime->run(Array)
#20 /app/web/vendor/drush/drush/drush(4): require('/app/web/vendor...')
#21 {main}. 
Error: Class name must be a valid object or a string in /app/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php on line 291 #0 /app/web/core/lib/Drupal/Core/
Entity/EntityTypeListener.php(89): Drupal\Core\Entity\EntityTypeManager->createHandlerInstance(NULL, Object(Drupal\Core\Entity\ContentEntityType))
#1 /app/web/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php(207): Drupal\Core\Entity\EntityTypeListener->onEntityTypeUpdate(Object(Drupal\Core\Ent
ity\ContentEntityType), Object(Drupal\Core\Entity\ContentEntityType))
#2 /app/web/core/modules/system/system.install(2283): Drupal\Core\Entity\EntityDefinitionUpdateManager->updateEntityType(Object(Drupal\Core\Entity\ContentEntity
Type))
#3 /app/web/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(185): system_update_8702(Array)
#4 /app/web/vendor/drush/drush/includes/batch.inc(235): Drush\Commands\core\UpdateDBCommands->updateDoOne('system', 8702, Array, Object(DrushBatchContext))     
#5 /app/web/vendor/drush/drush/includes/batch.inc(183): _drush_batch_worker()
#6 /app/web/vendor/drush/drush/includes/batch.inc(95): _drush_batch_command('431')
#7 /app/web/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(142): drush_batch_command('431')
#8 [internal function]: Drush\Commands\core\UpdateDBCommands->process('431', Array)
#9 /app/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(235): call_user_func_array(Array, Array)
#10 /app/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Ob
ject(Consolidation\AnnotatedCommand\CommandData))
#11 /app/web/vendor/consolidation/annotated-command/src/CommandProcessor.php(150): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, A
rray, Object(Consolidation\AnnotatedCommand\CommandData))
#12 /app/web/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(404): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Compo
nent\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 /app/web/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\LessStrictArgvInput)
, Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /app/web/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfo
ny\Component\Console\Output\ConsoleOutput))
#15 /app/web/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCom
mand), Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /app/web/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony
\Component\Console\Output\ConsoleOutput))
#17 /app/web/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfo
ny\Component\Console\Output\ConsoleOutput))
#18 /app/web/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#19 /app/web/vendor/drush/drush/drush.php(66): Drush\Runtime\Runtime->run(Array)
#20 /app/web/vendor/drush/drush/drush(4): require('/app/web/vendor...')
#21 {main}
Error: Class name must be a valid object or a string in Drupal\Core\Entity\EntityTypeManager->createHandlerInstance() (line 291 of /app/web/core/lib/Drupal/Core
/Entity/EntityTyp

eManager.php).


Allow Symfony 4 to be installed in Drupal 8

$
0
0

Problem/Motivation

Drupal 9 will release with either Symfony 4 or Symfony 5.

In order to be able to do that, we should make Drupal 8 compatible with Symfony 4.

1. Remove all use of deprecated Symfony 3 APIs.
2. allow Drupal 8 to be installed with Symfony 4 via composer, although packaging would stick to Symfony 3.

Proposed resolution

Resolve and commit the remaining issues needed to make symfony 4 pass tests
Commit the patch to allow installing Symfony 4 > 4.2.4 on Drupal 8
Start working on Symfony 5

Remaining tasks

The following outstanding issue must be committed to make the tests pass
#3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()

User interface changes

None

API changes

Symfony 4 api will be supported

Data model changes

None

Release notes snippet

Drupal now supports Symfony 4

Original report by @martin107

I want to pull and few threads together into an action.

The correctness of this has really bugged me in the few months since I read it....... in a good way.

https://www.drupal.org/project/drupal/issues/2937984#comment-12570221

Have an issue with a patch that updates to Symfony 4 so we can see if it passes or not.

And more publicly there have been blog post about the same idea

https://www.thirdandgrove.com/long-road-drupal-9

https://dri.es/when-should-we-release-drupal-9

The posts I summaries as

"Given the hard 2021 deadline and the desire to give contrib a year to adjust we better pick up our collective skirts and get a move on."

Please also note that a second correct perspective is to say

We have identified technical debut and parcelled it up into the form of entries in the DeprecationListenerTrait and are slowly clearing things up.

But my response is still to think ...

That is a nice, but with such a large code base there will be some green bug eyed monsters just in the cracks

We can act now with such a simple simple pipe cleaning exercise exercise.

So my first idiot style move is to change all symfony-X version numbers to "*" as see what breaks

EntityViewBuilder::addContextualLinks assumes an entity's canonical rel is routed/internal

$
0
0

Problem/Motivation

When using the Linky module and adding a Managed link entity with an external link, an exception will be thrown on the canonical route of that entity.

UnexpectedValueException: External URLs do not have internal route parameters. in Drupal\Core\Url->getRouteParameters() (line 571)

This is due to Drupal\Core\Entity\EntityViewBuilder->addContextualLinks assuming the canonical rel is internal/routed.

There's similar related issues with menu_link_content and the redirect contrib module:

#2935026: Deleting entity with external canonical link throws exception
#2914785: Entities with external urls as a uri relationship can not be deleted when menu_link_content is installed

Proposed resolution

Check the url is routed before using it.

layout_builder_post_update_make_layout_untranslatable() still attempts to query all revisions for non-revisionable entities

$
0
0

Problem/Motivation

layout_builder_post_update_make_layout_untranslatable() is still broken after #3048950: layout_builder_post_update_make_layout_untranslatable() attempts to query all revisions for non-revisionable entities, as reported by @azovsky in #3052318-13: update from 8.6.15 to 8.7 fails due to menu_link_content.

Proposed resolution

_layout_builder_bundle_has_no_layouts() and _layout_builder_bundle_has_no_translations() need to use the entity definition update manager when retrieving entity type definitions.

Remaining tasks

Do it.

drupal_mail() mismatches the 'Sender' header and the 'From' header

$
0
0

Contact form submissions put the site admin's information in the "sender information" part of the email header. In some email clients, this information is used to populate the "from" line, making it look like the email was sent by the site admin rather than the submitter.

I originally thought this was a webform but and posted the issue here: http://drupal.org/node/392472
But today I received a contact form submission with the same problem from a site where webform isn't even installed. So it looks like the problem originates within drupal core.

To quote part of my issue in the webform queue, "In the long headers, the From line is being populated correctly but most email apps are using the Sender information for the From line in the normal headers view.

This is my experience:

Mac Mail handles this correctly, putting the submitter's name and email in the From line

Thunderbird uses the correct From name and address but adds a "Sender" line with the Drupal admin email on it

Entourage puts the correct From name and address but adds (sent by *drupaladminemail*) to that line.

Outlook puts the Drupal admin email in the From line and says "on behalf of (submitter name and email)"

Outlook Web Access actually puts the drupal admin's name in the from line, and adds "on behalf of (submitter's name), though I'm guessing it only knows the admin name since it recognizes the email address from Active Directory.

Thinking this might have something to do with our exchange system, I changed the recipient to an account on a different email server and experienced the same results."

I have experienced this on several different versions of drupal, the latest being 6.14 with a very light selection of modules.

If this is happening for everyone then it seems it needs to be changed somehow! Having a wrong email address attached to every contact form submission is confusing. But if it's not happening to everyone, any ideas why it might be happening to me? Someone else responded in the other issue thread and had the same problem so I know I'm not alone here.

Tabs should remain horizontal on desktop beyond a certain width

$
0
0

There is logic in /core/themes/seven/js/nav-tabs.js that if the height of a set of tabs is taller the first set of tabs, (primary tabs), to switch to a vertical or mobile view. This is great on mobile and tablet, but doesn't work well on large desktop, as you end up with very long full-width vertical tabs that push everything way below the fold. For example if you have many display modes, it pushes everything below the fold:

below the fold

In my case, when the secondary tabs are set to verity on a macbook retina on /admin/structure/types/manage/article/display, the ul.tabs.secondary these secondary tabs are 1375 pixels in height! (Labels changed to preserve anonymity).

I don't believe any special is required to recreate this. Just create a bunch of view modes.

Proposed Solution:

Update the logic to exclude the vertical tabs after a certain width.

Add status report check for theme composer dependencies

$
0
0

Problem/Motivation

We are planning to move Drupal 8 Classy into a contrib project. To ensure a smooth transition, sites containing themes depending on Classy should automatically be able to download Classy from contrib space in the process of upgrading to Drupal 9.

Proposed resolution

Add check for the status report page to ensure that theme dependencies have been listed correctly in composer.json.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

comment_update_8701 fails if there are comments without field_name

$
0
0

Experiencing following error while updating from 8.6.15 to 8.7.0.

>  [notice] Update started: comment_update_8701
>  [error]  Exception thrown while performing a schema update. SQLSTATE[01000]: Warning: 1265 Data truncated for column 'field_name' at row 1: ALTER TABLE {comment_field_data} CHANGE `field_name` `field_name` VARCHAR(32) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL; Array
> (
> )
>  
>  [error]  Update failed: comment_update_8701 

This is caused by empty values in field_name fields in database


[Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation()

$
0
0

Problem/Motivation

Symfony 4 uses strict types in the Constraint system, typecasting translateable markup to strings. This causes the twig system to make the string html safe, escaping the html we include in the message.

Proposed resolution

Create a subclassed ConstraintViolation that supports MarkupInterface and use that in core.

Remaining tasks

Create the subclass
Replace usage throughout core
Change Record?

User interface changes

none.

API changes

Switch to the subclassed Violation class for core violations.

Data model changes

none.

Release notes snippet

Allow 'syncing' content to be updated in content moderation without forcing the creation of a new revision

$
0
0

Problem/Motivation

For a long time content_moderation has always created a new revision when saving a moderated entity and controlled the publishing and defaultness of that revision according to the configured moderation workflow.

There are some cases where a moderated entity might require non-content related metadata to be updated, content to be synced into a particular revision from some other source (such as the lingotek module syncing translation information into a particular entity translation revision) or updated via a workspaces deployment in the future: #3037136: Make Workspaces and Content Moderation work together.

Proposed resolution

It would be a significant change in the API to switch off new revisions by default for content moderation, but we can leverage SynchronizableInterface to provide an API to opt out of specifically the semantics of:

  • Forcing a new revision every save.
  • Adjusting the default status of the revision being saved.

Specifically while syncing, changes to the moderation state itself:

  • Will still be reflected.
  • Will still update the 'publishing' status of the revision according to the given workflow.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

How to save files to a private directory

$
0
0

Hi,

I am writing a custom module in which data is written to a file and the file is stored in a private directory folder.

In order to do so I have created a private directory and assigned required permissions to it(can conform it is writable, tested it by creating a new content type from UI and added a file upload filed and able to save uploaded file to that directory). But my problem is I cant save the file to that directory programmatically .

I get an error stating :

>The data could not be saved because the destination /var/www/html/sites/sitename/files/private/file.json is invalid. This may be caused by improper use of file_save_data() or a missing stream wrapper.

My private directory is located in files directory as a sub directory and named as private , I have configured it in settings.php and can view it in `https://example.com/admin/config/media/file-system` ofcourse cleared the cache after configuring private directory in settings.php.

I can save file into public directory using the following code:

$output = Json::encode($data);

$directory = file_default_scheme() . '://userslist';

file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);

$fileLocation = $directory.'/'.JSON_FILENAME;

$file = file_save_data($output, $fileLocation, FILE_EXISTS_REPLACE);

But I cant save in subfolder in public directory using the following code :

$directory = \Drupal::service('file_system')->realpath("public://userslist");

Same is the case with private directory :

$directory = \Drupal::service('file_system')->realpath("private://");

I can even save data using the following code :

$directory = file_default_scheme() . '://private';

as private directory is present as a sub directory in public directory hence assigned manually public directory path above.

But can't save using the

realpath

which obtains the private or public file directory path dynamically.

Can anyone help me out to solve the issue.

I tried the functionality in two different system environments one is linux and other is windows and I get the same error as above.

Thanks.

The "from state" used for calculating available transitions is changed when using the content moderation state widget and preview mode

$
0
0

Problem/Motivation

The workflow transitions are not working properly when using preview mode , prior to saving content.

When clicking to preview and returning to edit mode, the content moderation current state (initial state ) is changed.
The workflow transition when saving would then not be the same ( the "from" being different).

If that new transition is not allowed , it would not even allow saving the modifications
if some rules are set for each independant transition, the whole thing is messed up.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Display post date in Time Ago format

$
0
0

I can't find how to display the post date in Time ago format, However It is possible to do with a custom date time field!

Viewing all 295855 articles
Browse latest View live


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