Brooklyn, NY
Account created on 25 September 2008, over 16 years ago
#

Merge Requests

More

Recent comments

🇺🇸United States jrockowitz Brooklyn, NY

The short answer is people have to upgrade to resolve this issue

🇺🇸United States jrockowitz Brooklyn, NY

I reverted the commit.

🇺🇸United States jrockowitz Brooklyn, NY

@BramDriesen My jaw dropped when I logged back in. I was about to re-roll the MR when I saw that you had already done it. Thank you!!!

🇺🇸United States jrockowitz Brooklyn, NY

We probably need to rebase this because of 📌 Convert to OOP Hooks Active

🇺🇸United States jrockowitz Brooklyn, NY

Your persistence has paid off. I am at DrupalCon is time to merge this. Thank you!!!

🇺🇸United States jrockowitz Brooklyn, NY

While it is a big patch, this is the same process used for core to convert, and we can spot check that the conversions are accurate. Since this is rector it's really just copying the hooks to a hook class an method.

Webform also has more tests than most modules so we can have more confidence than most modules would have that this won't introduce systemic issues.

I completely agree with you that this should not introduce systemic issues and merging it would nudge more contrib modules to use OOP hooks.

🇺🇸United States jrockowitz Brooklyn, NY

I have to agree that this is a release blocker

🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

Since we are changing the $form array, this should be only committed to 6.3.x

🇺🇸United States jrockowitz Brooklyn, NY

Here is the change record. With tests passing, I am fine with merging this.

🇺🇸United States jrockowitz Brooklyn, NY

There are security implications for allowing someone to specify the submission owner via query parameter.

ChatGPT suggested the below approach which is a valid solution

/**
 * Implements hook_webform_submission_presave().
 *
 * Allow setting the webform submission owner from a query string parameter.
 */
function MYMODULE_webform_submission_presave(WebformSubmissionInterface $webform_submission) {
  // Check if a query parameter 'submission_owner' exists.
  $owner_uid = \Drupal::request()->query->get('submission_owner');
  
  if ($owner_uid && is_numeric($owner_uid)) {
    // Ensure the user ID exists in the system.
    $user = \Drupal\user\Entity\User::load($owner_uid);

    if ($user) {
      // Set the submission's owner to the user ID from the query string.
      $webform_submission->setOwnerId($owner_uid);
    }
  }
}
🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

I think we need to fork the webform bootstrap 3 module into a dedicated project and deprecate the code in the webform module.

🇺🇸United States jrockowitz Brooklyn, NY

In a form alter hook, you can change the $form['progress'] weight or alter the $form array.

ChatGPT suggested the below approach, which is completely valid and the simplest solution

/**
 * Implements hook_form_alter().
 */
function mymodule_form_alter(array &$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  // Check if the form ID matches the webform submission form.
  if ($form_id == 'webform_submission_form') {
    // Save the progress element into a temporary variable.
    $progress_element = $form['progress'];
    // Remove the progress element.
    unset($form['progress']);
    // Add the progress element to the end of the form.
    $form['progress'] = $progress_element;
  }
}
🇺🇸United States jrockowitz Brooklyn, NY

Please review the MR based on #17 which tries to keep the changes as simple as possible.

🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

I am for any patch that simplifies the JS code and is safe to commit.

Core at some point reversed https://www.drupal.org/node/1570578 and use strict is no longer included in core JS.

🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

Let's update the URL field to support 2048 characters @see https://serpstat.com/blog/how-long-should-be-the-page-url-length-for-seo/

🇺🇸United States jrockowitz Brooklyn, NY

Let's update the URL field to support 2048 characters @see https://serpstat.com/blog/how-long-should-be-the-page-url-length-for-seo/

🇺🇸United States jrockowitz Brooklyn, NY

Let's update the URL field to support 2048 characters @see https://serpstat.com/blog/how-long-should-be-the-page-url-length-for-seo/

🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

I think the current OOTB approach is the use something like IMCE to upload a file to the public file directory and attach the file via the Attachment URL element.

If we were going to support attachments via file upload I would opt for Attachment File element, which could be maintained in a dedicated contributed module. Does this approach make sense?

🇺🇸United States jrockowitz Brooklyn, NY

Make sense that a mailer application needs the body to be a string.

🇺🇸United States jrockowitz Brooklyn, NY

Adding a new property to Name would require a new 6.4.x version of Webform to be created.

This improvement should be handled in a dedicated contrib module. You can also use https://www.drupal.org/project/webform_composite to create this variation of a name input.

🇺🇸United States jrockowitz Brooklyn, NY

I tested the fix in Chrome and Firefox and it looks good.

🇺🇸United States jrockowitz Brooklyn, NY

MRs are welcome to help resolve this

🇺🇸United States jrockowitz Brooklyn, NY

We have been using this patch on production and it seem sreasonable that we want to ensure the webform_image_select.element library loads after webform.filter.js

🇺🇸United States jrockowitz Brooklyn, NY

The tweak looks fine to me, and enough people have reviewed this

🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

I validated that a group_relationship entity exists via https://git.drupalcode.org/project/group/-/blob/3.3.x/src/Entity/GroupRe... and it was added in 2022 (@see #3303321: Drop 2.0.x upgrade path and update machine names )

The code being updated was added via 📌 Support group v2/v3 Fixed
I would be happy to merge this is someone can confirm that we should have looking for the group_relationship entity and NOT the group_relation entity

🇺🇸United States jrockowitz Brooklyn, NY

I think gradually fixing eslint and other JS issue in smaller MRs might be the only approach because there is no JavaScript test coverage in the module.

🇺🇸United States jrockowitz Brooklyn, NY

I am going to go with this MR is good enough. The only breaking change is the removal of the completely unused \Drupal\webform\Plugin\WebformElement\TextFormat::hasCompositeElement added in 2017.

🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

I think the webform_default is no longer visible via the UI, and we might be able to close this ticket since we can't reproduce the issue and the suggestion from #6 is a valid fix.

🇺🇸United States jrockowitz Brooklyn, NY

I think the webform_default is no longer visible via the UI, and we might be able to close this ticket since we can't reproduce the issue and the suggestion from #6 is a valid fix.

🇺🇸United States jrockowitz Brooklyn, NY

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

🇺🇸United States jrockowitz Brooklyn, NY

I was experimenting with this patch and a bunch of update hooks failed with the below error

LogicException: withRelatableResourceTypes() must be called before getting relatable resource types. in Drupal\jsonapi\ResourceType\ResourceTypeRelationship->getRelatableResourceTypes() (line 48 of /var/www/html/docroot/core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php) #0 /var/www/html/docroot/core/modules/jsonapi/src/ResourceType/ResourceType.php(406): Drupal\jsonapi\ResourceType\ResourceTypeRelationship->getRelatableResourceTypes()

Sorry, I can't provide more details.

🇺🇸United States jrockowitz Brooklyn, NY

Yeh that patch is to core because Mercury Editor is extending HtmlEntityFormController and Workspaces does not support returning a RedirectResponse.

🇺🇸United States jrockowitz Brooklyn, NY

Here is quick fix for people wanting to revert back to the having the datelist title invisible.

/**
 * Implements hook_webform_element_alter())
 */
function MYMODULE_webform_element_alter(array &$element, \Drupal\Core\Form\FormStateInterface $form_state, array $context) {
  if (isset($element['#type']) && $element['#type'] === 'datelist') {
    $element['#after_build'][] = 'MYMODULE_webform_element_datelist_after_build';
  }
}

function MYMODULE_webform_element_datelist_after_build(array $element, FormStateInterface $form_state) {
  foreach (Element::children($element) as $child_key) {
    if (!isset($element[$child_key]['#title_display'])) {
      $element[$child_key]['#title_display'] = 'invisible';
    }
  }
  return $element;
}
🇺🇸United States jrockowitz Brooklyn, NY

I think all new functionality should be handled in dedicated contributed module like a webform_block_advanced.module which could extend or replace the webform block plugin.

🇺🇸United States jrockowitz Brooklyn, NY

We are posting a patch because we are not able to update the latest release.

🇺🇸United States jrockowitz Brooklyn, NY

Passing the \Drupal\Core\Field\FieldItemInterface or \Drupal\Core\Field\FieldItemListInterface to the below hooks feels like the right thing to do, and we MUST pass the BubbleableMetadata, which allows JSON-LD to be cached.

hook_schemadotorg_jsonld_schema_type_field_alter(array &$data, \Drupal\Core\Field\FieldItemListInterface $items, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata);

hook_schemadotorg_jsonld_schema_property_alter(mixed &$value, \Drupal\Core\Field\FieldItemInterface $item, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata);

hook_schemadotorg_jsonld_schema_properties_alter(array &$values, \Drupal\Core\Field\FieldItemListInterface $items, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata);
A maximum of 2 alterable arguments is supported. In case more arguments need to be passed and alterable, modules provide additional variables assigned by reference in the last $context argument:

@see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...

I experimented with adding $context, which contains the items, mapping, schema_type, and schema_property, and that started to feel ugly because users have started parsing through the $context. Moving $items to $context also breaks anyone's current implementation of these hooks.

The best compromise I can come up with is to provide a \Drupal\schemadotorg\Utility\SchemaDotOrgFieldHelper, which makes it easier to get the mapping, scheme type, and schema property.

Please review the attached proposed MR.

🇺🇸United States jrockowitz Brooklyn, NY

The MR addressed the immediate issue for me. We might want to use a human-readable format for the array, maybe YAML wrapped in PRE tags.

🇺🇸United States jrockowitz Brooklyn, NY

I completely understand that we must skip fixing the dependency injections.

If you are saying in a later commit, we can automatically fix the t() calls since all that is required is the trait and then a search and replace, this is good enough to be committed.

🇺🇸United States jrockowitz Brooklyn, NY

A https://schema.org/TextObject defines a text document (not a string of text), and https://schema.org/Text is a data type.

I don't think mapping a Paragraph to either TextObject or Text makes sense. It might make sense to map a paragraph to a https://schema.org/Thing, or personally I like https://schema.org/WebContent.

🇺🇸United States jrockowitz Brooklyn, NY

Your request makes sense. Let me think about the implications before we make the change.

Below are hooks that could have $schema_type and $schema_property defined. Another approach is to add a $context that would allows $schema_mapping, $schema_type, and $schema_property.

hook_schemadotorg_jsonld_schema_type_field_alter(array &$data, \Drupal\Core\Field\FieldItemListInterface $items, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata);

hook_schemadotorg_jsonld_schema_property_alter(mixed &$value, \Drupal\Core\Field\FieldItemInterface $item, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata);

hook_schemadotorg_jsonld_schema_properties_alter(array &$values, \Drupal\Core\Field\FieldItemListInterface $items, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata);
Production build 0.71.5 2024