Account created on 26 June 2018, almost 6 years ago
#

Merge Requests

More

Recent comments

🇻🇳Vietnam phthlaap

The HOOK_field_widget_form_alter has been deprecated, I think the issue summary needs update.

function hook_field_widget_single_element_form_alter(&$element, \Drupal\Core\Form\FormStateInterface $form_state, $context) {
  $field_definition = $context['items']->getFieldDefinition();
  if ($field_definition->getType() == 'decimal') {
    $element['value']['#step'] = 'any';
  }
}

https://www.drupal.org/node/3180429

🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3294700-warning-undefined-array-key-type to hidden.

🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3357973-grouped-exposed-taxonomy to active.

🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3357973-grouped-exposed-taxonomy to hidden.

🇻🇳Vietnam phthlaap

@alexpott the core.extension configuration is validated in core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php:93. I think we no need to validate again.

    $config_importer = $event->getConfigImporter();
    if ($config_importer->getStorageComparer()->getSourceStorage()->exists('core.extension')) {
      $this->validateModules($config_importer);
      $this->validateThemes($config_importer);
      $this->validateDependencies($config_importer);
    }
    else {
      $config_importer->logError($this->t('The core.extension configuration does not exist.'));
    }

It also have test cases to cover: core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php::testMissingCoreExtension

But even when it is validated I think we also need fix the core/modules/field/field.module:324 to prevent the TypeError message when access the page /admin/config/development/configuration

🇻🇳Vietnam phthlaap

As comment #40 I has explained, the variable name $states is no longer a jQuery instance. but, it will be identical to the state variable defined at the top of the file, so I named it element.

🇻🇳Vietnam phthlaap

#27 It will impact the import configuration form when there are no changes in the core extension.

🇻🇳Vietnam phthlaap

phthlaap made their first commit to this issue’s fork.

🇻🇳Vietnam phthlaap

I updated the issue summary to the correct format.

🇻🇳Vietnam phthlaap

As suggestion of @nod_ , I use Once library to fix the issue. I think it is better.
I also changed the variable name $states because it is no longer a jQuery instance. but, it will be identical to the state variable defined at the top of the file, so I named it element.

🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3386191-states-not-working-drupaljs to hidden.

🇻🇳Vietnam phthlaap

As @alexpott suggestion, I moved code to parent class but I dont know how to fix the test failed.

🇻🇳Vietnam phthlaap

The approach in patch #26 will affect some tests because I believe Ajax should reattach on form submission once again.

🇻🇳Vietnam phthlaap

Tested without addBack(tagsSupportDisable), the issue wasn't fixed. This change has been applied since patch #31.

🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3386191-9x-states-not-working to hidden.

🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3386191-states-not-working to active.

🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3386191-states-not-working to hidden.

🇻🇳Vietnam phthlaap

I think the issue didn't happen on 11.x, but I also converted patch to git branch for 11.x.
\Drupal\Tests\datetime\Kernel\Views\FilterDateTest::testDateOffsets run without the fix actually passes, the test didn't cover the issue.

🇻🇳Vietnam phthlaap

Can you please help provide sample code in any module?
Thanks.

🇻🇳Vietnam phthlaap

Resolved and added more tests to cover form with ajax.

🇻🇳Vietnam phthlaap

I resolved all items in comment #23. Please help to review.

🇻🇳Vietnam phthlaap

Tests already there. Can you help to suggest what is the upgrade path?

🇻🇳Vietnam phthlaap

This issue happen with submit button

$form['actions']['submit'] = [ 
  '#type' => 'submit',
  '#value' => $this->t('Submit'),
  '#states' => [
    'disabled' => [':input[name="allow_overwrite"]' => ['checked' => FALSE]],
  ],  
];
🇻🇳Vietnam phthlaap

phthlaap changed the visibility of the branch 3354998-states-disable-elements to hidden.

🇻🇳Vietnam phthlaap

I've created a merge request for version 11.x and added test coverage.

🇻🇳Vietnam phthlaap

As I mentioned in comment #23, the Json API module has a test to ensure that a file with zero bytes can be uploaded successfully. That test conflicts with this feature request, and I am unsure about what steps to take next.

\Drupal\Tests\jsonapi\Functional\FileUploadTest::testFileUploadZeroByteFile

🇻🇳Vietnam phthlaap

Hi @Wim Leers, Thanks for your help to review.

If the arguments has a array item inside it will show the notice.

$variables['arguments'] = ['foo_bar', ['sample']];
var_dump(preg_replace('/[^a-zA-Z0-9]/', '_', $variables['arguments']));
🇻🇳Vietnam phthlaap

It seems to conflict with a test in the JSONAPI module. They expected the zero-byte file to upload successfully.

\Drupal\Tests\jsonapi\Functional\FileUploadTest::testFileUploadZeroByteFile

🇻🇳Vietnam phthlaap

phthlaap made their first commit to this issue’s fork.

🇻🇳Vietnam phthlaap

Fixed the issue on 11x branch and create merge request. Added a tests.

Production build 0.69.0 2024