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

"session_id(): Cannot change session id" Warning with PHP 7.2

$
0
0

After moving from PHP 5.6 to PHP 7.2, this warning shows up in my logs (admin/reports/dblog):

Warning: session_id(): Cannot change session id when headers already sent in drupal_session_initialize()
(Line 266 of ... /includes/session.inc).

I couldn't find anything on this other than an issue in Durpal 8. Did anyone else run into this?

Line 266 of session.inc:

    session_id(drupal_random_key());
    if ($is_https && variable_get('https', FALSE)) {
      $insecure_session_name = substr(session_name(), 1);
      $session_id = drupal_random_key();
      $_COOKIE[$insecure_session_name] = $session_id;
    }

Hardcoded result size limit in the entity reference autocomplete widget.

$
0
0

Problem/Motivation

The EntityReferenceAutocompleteWidget will always return a maximum of 10 results, which is caused by the call $entity_labels = $handler->getReferenceableEntities($string, $match_operator, 10); in Drupal\Core\Entity\EntityAutocompleteMatcher::getMatches().

Proposed resolution

Make the match size limit configurable as is the case with the operator.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Inconsistent ordering of views of content in Umami

$
0
0

Problem/Motivation

I have set up the Umami demo on my local machine and on simplytest.me.

The order of articles/recipes on the home page is inconsistent.

Local:

Simplytest.me

This is because all the recipes/articles all have the same creation time, so the sort is undefined.

This in no ways impacts Umami when used as a demo, but does make it more difficult to A/B test changes, especially if we start using BackStop or similar to check for regressions.

Proposed resolution

Add creation dates to the content – either fixed or relative to the install date.

Prevent PHP notice "Undefined index: callback_object" if calling FormState::getFormObject() when the form object is not yet set

$
0
0

Problem/Motivation

The public method FormState::getFormObject() directly retrieves the callback object from the build info array without checking if it is present and in the cases where it is not yet set then a PHP notice will be raised:

"Notice: Undefined index: callback_object in Drupal\Core\Form\FormState->getFormObject() (line 1166 of core/lib/Drupal/Core/Form/FormState.php)."

Proposed resolution

We have two options:
1. Add a new method FormState::hasFormObject()
or
2. FormState::getFormObject() should check if the callback object is present in the build info array and only then access it and return it or otherwise just return NULL.

As we could always check through ($form_object = $form_state->getFormObject()) option 2 is the more developer friendly solution which we should implement.

Remaining tasks

User interface changes

API changes

Data model changes

oEmbed system can't parse XML attributes

$
0
0

Problem/Motivation

Steps to reproduce:

Add this to a custom module:

function mymodule_media_source_info_alter(&$sources) {
  $sources['audio_oembed'] = [
    'id' => 'audio_oembed',
    'label' => t('Remote audio'),
    'description' => t('Use audio from remote sources.'),
    'allowed_field_types' => ['string'],
    'default_thumbnail_filename' => 'no-thumbnail.png',
    'providers' => ['SoundCloud'],
    'class' => 'Drupal\media\Plugin\media\Source\OEmbed',
  ];
}

Set up a media type using the source.

When you try to save a new media item pointing to soundcloud, you get the following error:

"The provided URL does not represent a valid oEmbed resource."

This is because soundcloud specifies type float for their oembed version, and Symfony's xml parser returns an array for floats.

Proposed resolution

Patch attached which makes it work, but not sure what the best solution is here.

Remaining tasks

User interface changes

API changes

Data model changes

[policy, no patch] Standardize writing style for Umami in Spanish.

$
0
0

Problem/Motivation

It is important to have a professional and consistent writing style across content in the Umami demo installation profile.
For the English content this was evolved in #2940146: Standardize writing style for Umami.

We have agreed to translate Umami content in to Spanish in #2999935: Choose the next language in which to translate demo_umami content. We should next work out the Spanish equivalent of these standards before translation of content can begin.

Proposed resolution

Propose and agree standards.

Remaining tasks

Propose and agree standards.

User interface changes

None.

API changes

None.

Data model changes

None.

Users w/o access to content should still have configurable access to the content URL

$
0
0

Problem/Motivation

The \Drupal\views\Plugin\views\field\LinkBase::render() method is presuming too much by not rendering a link whose destination page is not accessible by the current user. The actual behaviour could cover most of the cases but there are still business scenarios when a role should be able to list content, including the URL, but still without the ability to access the content page. This is somehow similar to view label entity access introduced in https://www.drupal.org/node/2661092.

Not having access to a content item, doesn't mean automatically that the content's address cannot be read.

Proposed resolution

Add a new option "bypass_access" in \Drupal\views\Plugin\views\field\LinkBase that allows the site builder to bypass the access check when a link is rendered. The new option should default to FALSE, so the behavior of the actual will not be changed.

Remaining tasks

None.

User interface changes

New option as a checkbox the the Views link fields.

API changes

None.

Data model changes

Views config new option in fields.

Dialog drupalAutoButtons option should be respected on initial load

$
0
0

When a drupal form is opened in a dialog, the submit buttons are automatically turned into jquery ui dialog buttons.

Sometimes this is not wanted and the drupalAutoButtons options is supposed to control if this is needed or not. Setting this at FALSE from the PHP doesn't do anything, buttons are still created.

Patch fixes the missing js that makes this option work as expected. This can be tested with the outside-in module. Before patch submit buttons are at the bottom of the dialog styled like jQuery dialog buttons, after the patch they're regular form submit buttons.


Unable to change non-translatable field value on translatable content with content moderation enabled.

$
0
0

Unable to change non-translatable field value on translatable content with content moderation enabled, because of EntityUntranslatableFieldsConstraintValidator::validate

To reproduce:
1) Install D8.5.0 with the standard profile in EN language.
2) Enable content moderation on Article node type.
3) Enable 'Content Translation' (with dependent Language) module.
3) Add another language.
4) Enable translation of Article content type at Configuration --> Content language and translation, set all fields translatable, except Tags.
5) On manage fields, disable 'Users may translate this field' for Tags field.
6) Add new Article node, with e.g. 'Test' tag and publish content.
7) Create new draft on the created node and change Tags field - e.g. delete 'Test' tag, or add another one.

You wouldn't be able to save the node because of validation error:
Non-translatable fields can only be changed when updating the current revision.

Solutions:
a) the EntityUntranslatableFieldsConstraintValidator::validate() should check if the content isModeratedEntity() or
b) content moderation module should extend EntityUntranslatableFieldsConstraintValidator::validate()

TypeError: Argument 1 passed to _editor_get_file_uuids_by_field() must implement interface Drupal\\Core\\Entity\\EntityInterface

$
0
0

user edit page: when add a custom field named person, when I save my user information, it reports this error like below:

[Mon May 21 01:21:49.224782 2018] [:error] [pid 15769] [client 172.17.0.1:48758] TypeError: Argument 1 passed to _editor_get_file_uuids_by_field() must implement interface Drupal\\Core\\Entity\\EntityInterface, null given, called in /var/www/html/core/modules/editor/editor.module on line 384 in /var/www/html/core/modules/editor/editor.module on line 554 #0 /var/www/html/core/modules/editor/editor.module(384): _editor_get_file_uuids_by_field(NULL)\n#1 [internal function]: editor_entity_update(Object(Drupal\\user\\Entity\\User))\n#2 /var/www/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(402): call_user_func_array('editor_entity_u...', Array)\n#3 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(169): Drupal\\Core\\Extension\\ModuleHandler->invokeAll('entity_update', Array)\n#4 /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(730): Drupal\\Core\\Entity\\EntityStorageBase->invokeHook('update', Object(Drupal\\user\\Entity\\User))\n#5 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(470): Drupal\\Core\\Entity\\ContentEntityStorageBase->invokeHook('update', Object(Drupal\\user\\Entity\\User))\n#6 /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(615): Drupal\\Core\\Entity\\EntityStorageBase->doPostSave(Object(Drupal\\user\\Entity\\User), true)\n#7 /var/www/html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(395): Drupal\\Core\\Entity\\ContentEntityStorageBase->doPostSave(Object(Drupal\\user\\Entity\\User), true)\n#8 /var/www/html/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(820): Drupal\\Core\\Entity\\EntityStorageBase->save(Object(Drupal\\user\\Entity\\User))\n#9 /var/www/html/core/lib/Drupal/Core/Entity/Entity.php(387): Drupal\\Core\\Entity\\Sql\\SqlContentEntityStorage->save(Object(Drupal\\user\\Entity\\User))\n#10 /var/www/html/core/modules/user/src/ProfileForm.php(38): Drupal\\Core\\Entity\\Entity->save()\n#11 [internal function]: Drupal\\user\\ProfileForm->save(Array, Object(Drupal\\Core\\Form\\FormState))\n#12 /var/www/html/core/lib/Drupal/Core/Form/FormSubmitter.php(111): call_user_func_array(Array, Array)\n#13 /var/www/html/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\\Core\\Form\\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\\Core\\Form\\FormState))\n#14 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(585): Drupal\\Core\\Form\\FormSubmitter->doSubmitForm(Array, Object(Drupal\\Core\\Form\\FormState))\n#15 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(314): Drupal\\Core\\Form\\FormBuilder->processForm('user_form', Array, Object(Drupal\\Core\\Form\\FormState))\n#16 /var/www/html/core/lib/Drupal/Core/Controller/FormController.php(74): Drupal\\Core\\Form\\FormBuilder->buildForm('user_form', Object(Drupal\\Core\\Form\\FormState))\n#17 [internal function]: Drupal\\Core\\Controller\\FormController->getContentResult(Object(Symfony\\Component\\HttpFoundation\\Request), Object(Drupal\\Core\\Routing\\RouteMatch))\n#18 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)\n#19 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#20 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#21 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)\n#22 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#24 /var/www/html/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#25 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#26 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#27 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#28 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#29 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#30 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#31 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#32 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#33 /var/www/html/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#34 {main}, referer: http://localhost:8181/user/2/edit?destination=/admin/people

Update manager using ssh2 doesn't error when copying doesn't work

$
0
0

Update manager signifies that the installation of a module or theme is successful even if it's not, when using ssh. That's because the return of ssh_exec is not parsed properly. I have cooked up a patch which enables this, but I'm not sure if that's the proper fix.

I triggered this bug because update manager doesn't work via ssh when the temp directory is /tmp and systemd's private tmp is enabled for the webserver.

(Un)Publish actions on admin/content screen are broken

$
0
0

As a non admin user with access to edit any node, but without access to "administer nodes" I can not use the actions "Unpublish content" and "Publish content" on the /admin/content screen.

I get this error:

Error message
No access to execute Unpublish content on the Content My page.

When I edit the page and uncheck the published flag I can unpublish the node.

After some debugging I found the this code to be responsible:

UnpublishAction.php:

  public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
    $key = $object->getEntityType()->getKey('published');

    /** @var \Drupal\Core\Entity\EntityInterface $object */
    $result = $object->access('update', $account, TRUE)
      ->andIf($object->$key->access('edit', $account, TRUE));

    return $return_as_object ? $result : $result->isAllowed();
  }

"$object->$key->access('edit', $account, TRUE)" returns -1 because I don't have the "administer nodes" permission.

I should not need this permission because I do have access to publish and unpublish.

IE11 & Chrome(PointerEvents enabled) & some Firefox scroll to the top of the page after dragging the bottom item with jquery 1.5 <-> 1.11

$
0
0

Please credit `svenryen, nattie, joseph.olstad, mforbes, bwaindwain` from #2908543: Tabledrag is broken when you've scrolled down on the page in chrome 61

Problem/Motivation

After two recent commits, the drag and drop behavior is bugged in IE11: when dragging the bottom item, the page is scrolled to the top of the page.

Behavior before (7.50):

Current behavior (7.53):

The related commits are:
- #1261002: Draggable tables do not work on touch screen devices
- #2821441: Newer Chrome versions and IE11/Edge cannot drag and drop anymore on desktop after 7.51 update when jQuery is updated to 1.7-1.11.0

Proposed resolution

Return the drag and drop behavior in IE11 to the state of Drupal <7.51

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

The drag and drop behavior in IE11 is unchanged compared to Drupal <7.51

API changes

None

Data model changes

Note to maintainers

We have two solutions in #81 and in #87, which both solve the problem, but have slight differences in how they check for NULL or UNDEFINED values. The "rtbc" applies to both of them (I think).
All arguments for either solution have been articulated in the comments.

Recent commenters have tested #87.

A maintainer should make a judgement call, and apply one of them.

Add Pol as provisional Drupal 7 branch maintainer

$
0
0

Hi all,

I'm proposing myself to be Drupal 7 maintainer. Now that I'm having more time to dedicate to Drupal again, I'm proposing my help.

The last projects I've been involved in are:

The last issue in Drupal 7 that I'm trying to fix: #2981726: Let the 'html_tag' element render children if any (backport from d8)

I'm really motivated to push this forward and give a kind of "second life" to Drupal 7.

Thanks in advance :)

[PHP 7.2] Avoid count() calls on uncountable variables


Fix call to count() on non-countable $links in theme_links()

$
0
0

The $links variable in theme_links() can be NULL which is not countable.

Add hook_post_config_import_NAME after config import

$
0
0

Problem/Motivation

Drupal core has a hook_update_N() mechanism with which developers can fix the database. But often we also want to abuse it to deploy other changes. This can lead to the situation that we would like to import the configuration before running the update hooks. But this is a very bad idea and will not be possible in the future.

See #2762235: Ensure that ConfigImport is taking place without outstanding updates and #2628144: Ensure that ConfigImport is taking place against the same code base.

The use case for this is for example adding a new field and dynamically populating it during a particular deployment.

Proposed resolution

Add a hook_post_config_import_NAME called after a config import so that developers can easily write one-off hooks for deployments and still always run the update hooks before the config import.

Remaining tasks

User interface changes

none

API changes

new hooks.

Data model changes

none

Call to a member function getThirdPartySetting() on null in ContentTranslationManager

$
0
0

I'm using config_installer to install. Almost at the end of the installation, I get the following fatal error. I previously applied patch 1356276-302, but I don't think this is related. It started happening after upgrading core to 8.3.0. The install does not finish correctly (the site has no admin user set). Any help or workaround is appreciated.

~/p/n/n/d/bin (master ⚡☡=) ./drush site-install config_installer config_installer_sync_configure_form.sync_directory=/var/www/drupal/config/sync --verbose --db-url=mysql://root:xxx@db/drupal --account-name=admin --account-pass=xxx -y
Executing: mysql --defaults-extra-file=/tmp/drush_IucryR --database=drupal --host=db --silent  < /tmp/drush_4Sag50 > /dev/null
You are about to DROP all tables in your 'drupal' database. Do you want to continue? (y/n): y
Sites directory /var/www/drupal/web/sites/default already exists -      [notice]
proceeding.
Executing: mysql --defaults-extra-file=/tmp/drush_mYQQIy --database=drupal --host=db --silent  < /tmp/drush_nu5C8H > /dev/null
Executing: mysql --defaults-extra-file=/tmp/drush_hGpyVf --database=drupal --host=db --silent  < /tmp/drush_vyJbkp
Executing: mysql --defaults-extra-file=/tmp/drush_YotAaX --database=drupal --host=db --silent  < /tmp/drush_S0z3x6
Starting Drupal installation. This takes a while. Consider using the        [ok]
--notify global option.
Error: Call to a member function getThirdPartySetting() on null in /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationManager.php on line 98 #0 /var/www/drupal/web/core/modules/content_translation/content_translation.module(166): Drupal\content_translation\ContentTranslationManager->isEnabled('media', '')
#1 /var/www/drupal/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(501): content_translation_entity_bundle_info_alter(Array, NULL, NULL)
#2 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php(110): Drupal\Core\Extension\ModuleHandler->alter('entity_bundle_i...', Array)
#3 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php(80): Drupal\Core\Entity\EntityTypeBundleInfo->getAllBundleInfo()
#4 /var/www/drupal/web/core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php(95): Drupal\Core\Entity\EntityTypeBundleInfo->getBundleInfo('block')
#5 /var/www/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\Core\Entity\Plugin\DataType\Deriver\EntityDeriver->getDerivativeDefinitions(Array)
#6 /var/www/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array)
#7 /var/www/drupal/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(283): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions()
#8 /var/www/drupal/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(174): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions()
#9 /var/www/drupal/web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryCachedTrait.php(22): Drupal\Core\Plugin\DefaultPluginManager->getDefinitions()
#10 /var/www/drupal/web/core/lib/Drupal/Core/TypedData/DataDefinition.php(193): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('field_item:stri...')
#11 /var/www/drupal/web/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(566): Drupal\Core\TypedData\DataDefinition->getClass()
#12 /var/www/drupal/web/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(555): Drupal\Core\Field\BaseFieldDefinition->getFieldItemClass()
#13 /var/www/drupal/web/core/lib/Drupal/Core/Field/BaseFieldDefinition.php(485): Drupal\Core\Field\BaseFieldDefinition->getMainPropertyName()
#14 /var/www/drupal/web/modules/contrib/media_entity/src/Entity/Media.php(309): Drupal\Core\Field\BaseFieldDefinition->setDefaultValue('')
#15 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(204): Drupal\media_entity\Entity\Media::baseFieldDefinitions(Object(Drupal\Core\Entity\ContentEntityType))
#16 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(171): Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions('media')
#17 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityFieldManager.php(394): Drupal\Core\Entity\EntityFieldManager->getBaseFieldDefinitions('media')
#18 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityManager.php(154): Drupal\Core\Entity\EntityFieldManager->getFieldStorageDefinitions('media')
#19 /var/www/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(282): Drupal\Core\Entity\EntityManager->getFieldStorageDefinitions('media')
#20 /var/www/drupal/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1411): Drupal\Core\Entity\Sql\SqlContentEntityStorage->getTableMapping()
#21 /var/www/drupal/web/core/lib/Drupal/Core/Field/FieldStorageDefinitionListener.php(74): Drupal\Core\Entity\Sql\SqlContentEntityStorage->onFieldStorageDefinitionCreate(Object(Drupal\Core\Field\BaseFieldDefinition))
#22 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityManager.php(411): Drupal\Core\Field\FieldStorageDefinitionListener->onFieldStorageDefinitionCreate(Object(Drupal\Core\Field\BaseFieldDefinition))
#23 /var/www/drupal/web/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php(169): Drupal\Core\Entity\EntityManager->onFieldStorageDefinitionCreate(Object(Drupal\Core\Field\BaseFieldDefinition))
#24 /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationUpdatesManager.php(63): Drupal\Core\Entity\EntityDefinitionUpdateManager->installFieldStorageDefinition('content_transla...', 'media', 'content_transla...', Object(Drupal\Core\Field\BaseFieldDefinition))
#25 /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationUpdatesManager.php(77): Drupal\content_translation\ContentTranslationUpdatesManager->updateDefinitions(Array)
#26 /var/www/drupal/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): Drupal\content_translation\ContentTranslationUpdatesManager->onConfigImporterImport(Object(Drupal\Core\Config\ConfigImporterEvent), 'config.importer...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#27 /var/www/drupal/web/core/lib/Drupal/Core/Config/ConfigImporter.php(644): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('config.importer...', Object(Drupal\Core\Config\ConfigImporterEvent))
#28 /var/www/drupal/web/core/lib/Drupal/Core/Config/ConfigImporter.php(488): Drupal\Core\Config\ConfigImporter->finish(Array)
#29 /var/www/drupal/web/profiles/contrib/config_installer/config_installer.profile(139): Drupal\Core\Config\ConfigImporter->doSyncStep('finish', Array)
#30 /var/www/drupal/web/core/includes/batch.inc(252): config_install_batch_process(Object(Drupal\Core\Config\ConfigImporter), 'finish', Array)
#31 /var/www/drupal/web/core/includes/form.inc(874): _batch_process()
#32 /var/www/drupal/web/core/includes/install.core.inc(625): batch_process(Object(Drupal\Core\Url), Object(Drupal\Core\Url))
#33 /var/www/drupal/web/core/includes/install.core.inc(546): install_run_task(Array, Array)
#34 /var/www/drupal/web/core/includes/install.core.inc(117): install_run_tasks(Array)
#35 /var/www/drupal/vendor/drush/drush/includes/drush.inc(726): install_drupal(Object(Composer\Autoload\ClassLoader), Array)
#36 /var/www/drupal/vendor/drush/drush/includes/drush.inc(711): drush_call_user_func_array('install_drupal', Array)
#37 /var/www/drupal/vendor/drush/drush/commands/core/drupal/site_install.inc(84): drush_op('install_drupal', Object(Composer\Autoload\ClassLoader), Array)
#38 /var/www/drupal/vendor/drush/drush/commands/core/site_install.drush.inc(254): drush_core_site_install_version('config_installe...', Array)
#39 /var/www/drupal/vendor/drush/drush/includes/command.inc(422): drush_core_site_install('config_installe...', 'config_installe...')
#40 /var/www/drupal/vendor/drush/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#41 /var/www/drupal/vendor/drush/drush/includes/command.inc(199): drush_command('config_installe...', 'config_installe...')
#42 /var/www/drupal/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#43 /var/www/drupal/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#44 /var/www/drupal/vendor/drush/drush/drush.php(12): drush_main()
#45 {main}
Drush command terminated abnormally due to an unrecoverable error.       [error]
Error: Call to a member function getThirdPartySetting() on null in Drupal\content_translation\ContentTranslationManager->isEnabled() (line 98 of /var/www/drupal/web/core/modules/content_translation/src/ContentTranslationManager.php).

SETGID bit gets reset for newly created directories inside sites/default/files

$
0
0

I set the SETGID bit on files directory so that any new directories or files created by drupal/php inside sites/default/files will take the group ownership of parent directory i.e here `files`. But I figured out Drupal clears/unset the SETGID bit for newly created directories like css, php, js etc.

I checked with a simple script if it is an issue with PHP-FPM, but it was not. I think Drupal does chmod in his side while creating new dirs which turns out to SETGID bit to be unset automatically.

I found there is one SO question related to Wordpress ( https://superuser.com/questions/1271465/force-wordpress-php-to-respect-s... )

How to reproduce ?

    chown :deploy web/sites/default/files
    chmod g+s web/sites/default/files
    
    ls -al web/sites/default/files
    
    drwxrwxr-x    2 www-data deploy        4096 Nov  7 08:41 css
    drwxrwxr-x    2 www-data deploy        4096 Nov  7 08:32 js
    drwxrwxrwx    3 www-data deploy        4096 Nov  7 08:32 php

**Expected result** (x bit should be replaced by s for group)

    ls -al web/sites/default/files
    
    drwxrwsr-x    2 www-data deploy        4096 Nov  7 08:41 css
    drwxrwsr-x    2 www-data deploy        4096 Nov  7 08:32 js
    drwxrwsrwx    3 www-data deploy        4096 Nov  7 08:32 php

Is it an issue of Drupal 8 or a knowing behavior ? Any workaround for this issue ?

However I found something inside settings.php regarding chmod. I tried to uncomment and set my required permission like `02770` (Where 2 is SETGID bit) but it doesn't help.

     * Default mode for directories and files written by Drupal.
     *
     * Value should be in PHP Octal Notation, with leading zero.
     */
      $settings['file_chmod_directory'] = 2770;
    # $settings['file_chmod_file'] = 0664;

It seems like Drupal 7 obeyes setgid rule ( https://www.drupal.org/docs/7/install/step-3-create-settingsphp-and-the-... ) But why doesn't work for me. Doesn't it work for Drupal 8 ?

Ajax Error HTTP 200 on contact form

$
0
0

Hello,

We use Drupal 7.60 and we have an issue when a form contact is submitted:

a alert JS appears :

Error:
Une erreur HTTP AJAX s'est produite.
Code de statut HTTP : 200
Informations de débogage ci-dessous.
Chemin : /fr/system/ajax
StatusText: OK
ResponseText : string(25) "info@mysite.fr"
SELECT n.field_contact_shown_value_value AS field_contact_shown_value_value
FROM
{field_data_field_contact_email} m
WHERE (m.bundle = :db_condition_placeholder_0) AND (m.field_contact_email_value = :db_condition_placeholder_1) AND (n.language = :db_condition_placeholder_2)
GROUP BY m.entity_id
ORDER BY m.entity_id ASC[{"command":"settings","settings":{"basePath":"\/","pathPrefix":"fr\/","ajaxPageState":{"theme":"mysite","theme_token":"IhHoQ4DjafVsU3U6bC7mlX8nA_Xdtl-gGThLGjgIEzE","js":{"sites\/mysite\/modules\/contrib\/webform_ajax\/js\/webform_ajax.js":1}},"overlay":{"paths":{"admin":"node\/*\/webform\nnode\/*\/webform\/*\nnode\/*\/webform-results\nnode\/*\/webform-results\/*\nnode\/*\/submission\/*\nfield-collection\/*\/*\/edit\nfield-collection\/*\/*\/delete\nfield-collection\/*\/add\/*\/*\nmedia\/*\/edit\nmedia\/*\/multiedit\nmedia\/*\/delete\nmedia\/browser\nmedia\/browser\/*\nnode\/*\/edit\nnode\/*\/delete\nnode\/*\/revisions\nnode\/*\/revisions\/*\/revert\nnode\/*\/revisions\/*\/delete\nnode\/add\nnode\/add\/*\noverlay\/dismiss-message\nuser\/*\/shortcuts\nadmin\nadmin\/*\nbatch\ntaxonomy\/term\/*\/edit\nuser\/*\/cancel\nuser\/*\/edit\nuser\/*\/edit\/*\ntaxonomy\/*\/translate\ntaxonomy\/*\/translate\/*\nnode\/*\/translate\nnode\/*\/translate\/*\nnode\/*\/edit\/*\ntaxonomy\/term\/*\/translate\ntaxonomy\/term\/*\/translate\/*\ntaxonomy\/term\/*\/edit\/*","non_admin":"admin\/structure\/block\/demo\/*\nadmin\/reports\/status\/php"},"pathPrefixes":["en","fr","de"],"ajaxCallback":"overlay-ajax"},"webform_ajax":{"wrappers":{"webform-ajax-wrapper-17--35":{"wrapper_id":"webform-ajax-wrapper-17--35","nid":"17","sid":"11355"}},"url":"\/fr\/webform_ajax\/return_webform"}},"merge":true},{"command":"insert","method":"prepend","selector":"head","data":"\u003Cscript type=\u0022text\/javascript\u0022 src=\u0022https:\/\/dev.mysite.fr\/sites\/mysite\/modules\/contrib\/webform_ajax\/js\/webform_ajax.js?phvekr\u0022\u003E\u003C\/script\u003E\n","settings":null},{"command":"insert","method":null,"selector":null,"data":"\u003Cdiv id=\u0022webform-ajax-wrapper-17--35\u0022\u003E\u003Cdiv class=\u0022webform-confirmation\u0022\u003E\u003Cp\u003ENous vous remercions pour votre message. .\u003C\/p\u003E\u003C\/div\u003E\u003C\/div\u003E","settings":null},{"command":"insert","method":"prepend","selector":null,"data":"","settings":null}] drupal.js:621:11
attach/window.alert
https://dev.mysite.fr/misc/drupal.js:621:11
Drupal.displayAjaxError
https://dev.mysite.fr/misc/drupal.js:524:5
Drupal.ajax.prototype.error
https://dev.mysite.fr/misc/ajax.js:479:3
complete
https://dev.mysite.fr/misc/ajax.js:194:16
handleComplete
https://dev.mysite.fr/misc/jquery.js:144:52
ajax/w.onreadystatechange
https://dev.mysite.fr/misc/jquery.js:142:57

Thank you
Pierre

Viewing all 295107 articles
Browse latest View live


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