Account created on 18 July 2009, over 14 years ago
#

Merge Requests

More

Recent comments

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

@smustgrave the correct solution needs to be confirmed by @catch. once done can update the same

putting it back to NR for @catch attention.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

- Updated the IS
- Updated the proposed changes

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

If the views module does not exist, then this screen is not accessible and therefore it's not possible to reach the error.

I tried to add the collection route conditionally but the REST tests fail.

1. If the exception is commented out, it tries to create URL with entity.file.collection and ends up throwing an exception. If that is commented out too and URL to is created, then the dialog pops up. Click on cancel, it remains on the same page.
2. The problem occurs only when the language module is enabled and multiple languages are configured. If it's a single language site then the functionality works fine. The cancel stays on the same page, which would be the expected behavior. If multiple languages are configured then the delete confirmation popup doesn't open, it ends up with exception.

If the original fix of adding 'delete-form' is enabled then the delete confirmation pops-up and clicking on cancel, it remains on the same page.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

- IS updated
- fix as per #20 done

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

The issue it seems that the block loads the configuration for the first block found and therefore the arguments of the first form are used. However if you check the user input in $form_state, the values sent from the browser are correct. I'm assuming that the arguments are stored in hidden fields. If so, you can check for user input for these values and use them if found, otherwise use from arguments
e.g.

public function buildForm(array $form, FormStateInterface $form_state, $id) {
    $input_values = $form_state->getUserInput();
    $form['id_value'] = [
      '#type' => 'hidden',
      '#value' => isset($input_values['id_value'])? $input_values['id_value'] : $id,
    ];
    $form['txt'] = [
      '#type' => 'textfield',
      '#title' => 'Textfield',
      '#default_value' => $id,
      '#required' => TRUE,
    ];
    $form['submit'] = [
      '#type' => 'submit',
      '#value' => 'Submit'
    ];    
    return $form;
}

with this approach the submit and validate have the correct values for the argument fields.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

- Issue summary has been updated.
- Root cause of #1118016: conditional visibility of a managed_file using #states attribute does not work โ†’ not working has been identified and fixed. Different from the patch.
- Test case reused from #2847425-65: #states not affecting visibility/requirement of managed_file โ†’ and included.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

sukr_s โ†’ made their first commit to this issueโ€™s fork.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

- Issue summary updated. error screenshot added.
- New test case added
- Screenshot post fix added

The MR has failed at test case testUnmanagedGitIgnoreWhenGitNotAvailable which seems unrelated to the code fix. what should be done?

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

Adding screenshot #maxlength set to 15. UI doesn't allow more than 15 characters.

hidden older MR !4290

Pipeline has not run for MR !7188. How can I trigger this?

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

sukr_s โ†’ changed the visibility of the branch 1344552-password-confirm-field-11x to hidden.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

- I've updated the issue summary
- fixed the issue
- added test

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

The original code was always for "multiple files" and the test cases as well. The UI showed upload "files" even when a single file was being uploaded. So the fix was for ensuring that the right text is shown in the UI in case of single file upload. No other functionality or test cases are affected. e.g. line 300

 // Assert we can add multiple files.
 $this->assertTrue($assert_session->fieldExists('Add files')->hasAttribute('multiple'));

tests for multiple files

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

I'm unable to reproduce the issue. I tried the above steps and I see the message "A welcome message with further instructions has been sent to your email address." on the front page after registration.

Can you try with a clean Drupal setup and confirm if you are facing the problem.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

The button label has to change to "Choose file". I believe there is no way to assert this (or?). Attach screenshot from the automated run that shows that the label has been successfully changed

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

following line is the positive test cases.

$choose_files->hasButton('Choose file');

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

MR updated with fix and test cases have been updated as well.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

@phthlaap the fix that you have provided is very specific to #states. The duplicates loading of attachBehavior can cause problems for any other module or custom module. So it's best to fix the root cause rather than in the affected module. Enclosed in a patch with tests for the same using #states for testing.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

I setup the VS Code debug as listed above. However the breakpoint was never hit. My folder structure was d10\web. The ddev xdebug is launched from d10 folder. In VS Code the project was opened at d10\web path. So the breakpoint was never hit. I reopened the project in the d10 folder and the debugging started working. Thus added a note for the same.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

Modules like big_pipe invoke attachBehaviors that results in multiple attachment of behaviors for a given context. So maintain semaphore to ensure that the behavior is attached only once.

If the attachBehavior is called multiple times, then in states multiple states.Dependent objects are created for the same elements. However the initialise is not called in Trigger function for all the states.Dependent object since it checks if it was already initialised for an element. Therefore it's best to avoid multiple invocation of attachBehaviors to ensure that the behviors work as intended.

This fix ensures that attachBehavior is called only once for a given context

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

@smustgrave The fix resolves correctness of English in UI (plural vs. singular). Not sure how to add tests for this. If you can point to some documentation, that would be helpful.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

The issue is that the form_build_id is not cached when a new page is loaded or refreshed. This results in the buildForm being called twice. I believe due to this the pager increases the element count (assumption is that there are multiple pagers in the same page) and results in the page being reset to 0. I'm not sure why the cache is not set on a new form build.

However if you are still facing the issue, you can resolve it with the following.

In your showTokenValue function replace

$form['table_container']['table'][$token_id]['token_value']['#value'] = $token->getToken();

with the full definition of the token_value array i.e.

$form['table_container']['table'][$token_id]['token_value'] =  [
        '#type' => 'html_tag',
        '#tag' => 'p',
        '#value' => $token->getToken(),
        '#attributes' => [
          'id' => ["protected-token-{$token_id}-value"],
        ],
      ];

Hope this helps

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

patch enclosed. #multiple is set based on the number of files upload allowed. this sets the ui text properly

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

sukr_s โ†’ made their first commit to this issueโ€™s fork.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

Support for delete-form is required. I've tested this and it works fine.

๐Ÿ‡ฎ๐Ÿ‡ณIndia sukr_s

sukr_s โ†’ made their first commit to this issueโ€™s fork.

Production build https://api.contrib.social 0.62.1