Account created on 24 February 2010, over 15 years ago
#

Merge Requests

More

Recent comments

🇪🇸Spain isholgueras

After seeing that there is a new release for DDS that handle the Canvas rename, and after removing the canvas_dev_standard module as canvas does, it's ready for review and merge.

🇪🇸Spain isholgueras

After applying the rename on 📌 Update XB occurrences to Canvas Postponed , Tugboat was merged without changing it to canvas.

🇪🇸Spain isholgueras

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

🇪🇸Spain isholgueras

I've tested it in 2 different Drupal 11
- An existing Drupal 11 with Canvas and Conductor installed and configured. Replaced the existing module by the zip version, cleared caches and everything work.
- A basic Drupal 11 with Canvas. Reinstall the site, place conductor into web/modules/contrib/conductor and install it. Everything works as expected too.

RTBC for me.

🇪🇸Spain isholgueras

If the response from conductor has the Content-Type header with more attributes, like application/json; charset=UTF-8, the json is not correctly parsed.

🇪🇸Spain isholgueras

Thanks for the work @Rajeshreeputra! I'm going take your job and continue it.

🇪🇸Spain isholgueras

I've reviewed the code, looks good. I've also reviewed the functionality and it works as expected.

For me is a RTBC

🇪🇸Spain isholgueras

I think it's ready for a first review.

The steps to test is:
- Enable the module
- Add to the config page the api key and secret
- Make requests to the conductor api resources like using the route /conductor/api/{conductor-resource}
- /conductor/api/accounts

It should accept GET, PUT, POST and DELETE requests.

🇪🇸Spain isholgueras

Core is currently doing for /system/files/ route.

It uses an InboundPathProcessor to get the route of the file, set it to a query parameter and return just the /system/files to allow the route system to match the route, no matter how many / the file has, because now is in a query parameter.

class PathProcessorFiles implements InboundPathProcessorInterface {

  /**
   * {@inheritdoc}
   */
  public function processInbound($path, Request $request) {
    if (str_starts_with($path, '/system/files/') && !$request->query->has('file')) {
      $file_path = preg_replace('|^\/system\/files\/|', '', $path);
      $request->query->set('file', $file_path);
      return '/system/files';
    }
    return $path;
  }

}

Then, in the controller, it gets the target by accessing the file query parameter.

    $target = $request->query->get('file');
🇪🇸Spain isholgueras

I have one idea to write a test for this. If it works I think it will be easier to refactor this.

🇪🇸Spain isholgueras

Is this still an issue? I've went through:

1. Install Standard install profile
2. Install experience_builder
3. Create article node — let's assume it's node 1
4. Install xb_dev_standard
5. Go to /node/1 and ...
... add a new image (without the media module)

6. Click "Review 1 change" and "Publish"
7. Visit /node/1 and see my image

I can investigate deeper on when this was fixed, but I think this can be closed.

🇪🇸Spain isholgueras

I've added some concerns in the MR about duplicated conditions and code that can be removed.

🇪🇸Spain isholgueras

The only difference that this MR brings is the exception logged in the database and is step forward and we would have to delete this sooner or later. I'm OK with this.

I've fixed one phpunit test and all should be green now.

🇪🇸Spain isholgueras

Oh, I see it now. Ok, make sense then. I thought it was leftover code.

No, it doesn't make sense to rename it. I think it can be closed.

Thanks!

🇪🇸Spain isholgueras

After talking to @wim, I've realized that #10 📌 Move `PropSourceEndpointTest` into new `XbConfigEntityHttpApiTest::testComponent()` Active is adding a new task, so it's not ready.

The current MR1379 is only moving the test

🇪🇸Spain isholgueras

isholgueras changed the visibility of the branch 3510896-move-propsourceendpointtest-into to hidden.

🇪🇸Spain isholgueras

isholgueras changed the visibility of the branch 3510896-move-propsourceendpointtest-into to hidden.

🇪🇸Spain isholgueras

This project is currently configuring XB under Drupal CMS: https://github.com/phenaproxima/xb-demo

To have XB working, you need to add a specific xb field type component_tree under article or xb_page. No other content types are currently supported, and this project does that.

Here is the ticket where the conversation about supporting other content types is happening: 📌 Allow XB to be used on all node types Active

🇪🇸Spain isholgueras

If the issue is the

          $component = Component::load($component_instance['component']);
          assert($component instanceof Component);

Could we change only this assert with a regular if if we're in preview? Something like this draft code:

          $component = Component::load($component_instance['component']);
          // Avoid asserts in preview with zend.assertions=1 to improve message to users.
          if (!$isPreview) {
            assert($component instanceof Component);
          }
          elseif (!$component instanceof Component) {
            // Or anything else.
            throw new ComponentNotFoundException($component_instance['component'] . ' doesn\'t exist.');
          }

I'm probably missing something but that's the only assert we need to sort, right?

🇪🇸Spain isholgueras

After reviewing both MR, I think I feel mor comfortable with MR 1351 (ignoring changed). https://git.drupalcode.org/project/experience_builder/-/merge_requests/1351.

It doesn't require any front-end changes but it would probably be good idea for the front-end to also stop sending changed but it could be in follow-up

Agree, but I think you're covering it well by ignoring changed.

🇪🇸Spain isholgueras

After debugging a bit, I think it's because of this piece of code in ClientDataToEntityConverter

https://git.drupalcode.org/issue/experience_builder-3536247/-/blob/35362...

      if ($entity instanceof EntityChangedInterface && $name === 'changed') {
        $changed_timestamp = $items->first()?->get('value');
        assert($changed_timestamp instanceof Timestamp);
        $changed_timestamp_int = $changed_timestamp->getCastedValue();
        assert(is_int($changed_timestamp_int));
        $form_updated_changed_field = $changed_timestamp_int !== ((int) $entity_form_fields['changed']);
      }
    }

    assert(!is_null($entity->id()));
    $original_entity = $this->entityTypeManager->getStorage($entity->getEntityTypeId())->loadUnchanged($entity->id());
    assert($original_entity instanceof FieldableEntityInterface);
    // Filter out form_build_id, form_id and form_token.
    $entity_form_fields = array_filter($entity_form_fields, static fn (string|int $key): bool => is_string($key) && $entity->hasField($key), ARRAY_FILTER_USE_KEY);
    // Copied from \Drupal\jsonapi\Controller\EntityResource::updateEntityField()
    // but with the additional special-casing for `changed`.
    foreach ($entity_form_fields as $field_name => $field_value) {
      \assert(\is_string($field_name));
      if ($field_name === 'changed' && $form_updated_changed_field) {
        continue;
      }
      try {
        $original_field = $original_entity->get($field_name);

There is a case when the $form_updated_changed_field value is not TRUE so is set to the original field, and the opposite. I still working on how to reproduce it reliably.

🇪🇸Spain isholgueras

I've left some minor comments. Overall, It looks good to me though

🇪🇸Spain isholgueras

We decided that we're going to validate only the entities ($entity->validate) right before the $entity->save() to still validate Constraints and don't execute the form validate.

I'll work on that and adapt the tests.

🇪🇸Spain isholgueras

Revert issue title thanks to that PathAlias is only validating on form submit.

🇪🇸Spain isholgueras

I've updated the title to surface the real issue.

🇪🇸Spain isholgueras

It's not a beta blocker, but it's pretty useful to help with testing different MRs functionality

It was just requiring default_content.

🇪🇸Spain isholgueras

I've left a couple of comments in Gitlab in case something is missing.

Everything else looks good to me

🇪🇸Spain isholgueras

I've created the StagedConfigUpdateValidationTest and moved the testValidations.

@wim, @ted, Is there anything else you wanted to validate here?

🇪🇸Spain isholgueras

I was wondering...
- If that's related with some kind of race condition with these code components
- If these components must render only in the client (not in SSR) (maybe with client:only="react"
- If we should detect/configure which code components have this client:only

BTW, while testing this I think I've reached the limit of nested code components.

I had 18 nested code components (with slot and prop), and it breaks in the 19th.
"Undo last action" worked though.

🇪🇸Spain isholgueras

I think that this line: https://git.drupalcode.org/project/experience_builder/-/merge_requests/1... from 🐛 User is able to create pages with same URL alias Active will report correctly all those 500 errors to the client because in this other line: https://git.drupalcode.org/project/experience_builder/-/merge_requests/1..., there is catching the violations and returning a proper JsonResponse.

Imho, we could postpone this issue, or include this issue into 🐛 User is able to create pages with same URL alias Active scope.

🇪🇸Spain isholgueras

I was able to replicate that yesterday while working on 🐛 User is able to create pages with same URL alias Active . I think the transaction doesn't start, but there is no JsonResponse with the error/exception returned, and the "2 Errors" with a dropdown appeared, but without message.

🇪🇸Spain isholgueras

I can confirm that's an issue.

In ApiAutoSaveController::post we're validating the entities to be saved against the existing entities, but not against each other.

IMHO, that should trigger an exception and rollback the saves

    // Either everything must be published, or nothing at all.
    try {
      $transaction = $this->database->startTransaction();
      foreach ($entities as $entity) {
        $entity->save();
        $this->autoSaveManager->delete($entity);
      }
    }
    catch (\Exception $e) {
      if (isset($transaction)) {
        $transaction->rollBack();
      }
      Error::logException($this->logger, $e);
      throw $e;
    }

I think that's not a data loss, but could it be close to?

🇪🇸Spain isholgueras

I've set

SYMFONY_DEPRECATIONS_HELPER=max[total]=99999

and it doesn't work either.

🇪🇸Spain isholgueras

I've configured it to just have deprecations we have in experience_builder.
I've also disabled the fail on deprecations with:
- SYMFONY_DEPRECATIONS_HELPER= "disabled&ignoreFile=$DRUPAL_PROJECT_FOLDER/.phpunit-deprecation-ignore.txt" (see more)
- PHPUNIT_FAIL_ON_PHPUNIT_DEPRECATION=0: (see more)

But the job is still failing. Any idea?

🇪🇸Spain isholgueras

I've tested it in this branch and in 0.x. In 0.x can reproduce the issue but in this branch the user is there. Even I created a new Content Editor user (nacho) with the right permissions and works well.

The code looks good to me too, so I think it's RTBC.

🇪🇸Spain isholgueras

… but let's land !1204 first, that is much harder to reroll.

Sure! feel free to throw it back to me if we need a reroll here.

Production build 0.71.5 2024