🇬🇧United Kingdom @globexplorer

Account created on 27 October 2009, about 15 years ago
#

Recent comments

🇬🇧United Kingdom globexplorer

Thank you @oleksandr.s! I will remove the comment dependency from the config and once done give you credit for it.

🇬🇧United Kingdom globexplorer

Thanks @oleksandr.s! The problem here is, that the scorm field in that version can only be attached to entities of type node. We have to change some other bits in code and in database table to address this properly. The code change here would be not enough. Furthermore using layout builder with no node in route would that not be the logical next problem. Once we addressed all relying issues I will credit you for that issue.

🇬🇧United Kingdom globexplorer

Hi @oleksandr.s!

I think It would be better to remove the route match service at all. The node object can be retrieved from the fromatter ->getEntity() method itself.

see here:

    // Read the entity id from url
    $node = $items->getEntity();
    if ($node instanceof NodeInterface) {
      $nid = $node->id();
    }
🇬🇧United Kingdom globexplorer

This means that you have still meta data for entity in your config but the code has gone.

🇬🇧United Kingdom globexplorer

Fixed with Issue #3451617.

🇬🇧United Kingdom globexplorer

Fixed with the following patch for 11.11.x

🇬🇧United Kingdom globexplorer

Drupal should allow absolute links. At the moment I tracked the problem down to the RssFields row plugin located at
core/modules/views/src/Plugin/views/row

Relative urls are expected, because inside the row plugin, the relative urls will be transformed to aboslute ones. But of course limited to the drupal backend host.

This function makes it impossible to use absolute URLs:

  /**
   * Convert a rendered URL string to an absolute URL.
   *
   * @param string $url_string
   *   The rendered field value ready for display in a normal view.
   *
   * @return string
   *   A string with an absolute URL.
   */
  protected function getAbsoluteUrl($url_string) {
    // If the given URL already starts with a leading slash, it's been processed
    // and we need to simply make it an absolute path by prepending the host.
    if (strpos($url_string, '/') === 0) {
      $host = \Drupal::request()->getSchemeAndHttpHost();
      // @todo Views should expect and store a leading /.
      // @see https://www.drupal.org/node/2423913
      return $host . $url_string;
    }
    // Otherwise, this is an unprocessed path (e.g. node/123) and we need to run
    // it through a Url object to allow outbound path processors to run (path
    // aliases, language prefixes, etc).
    else {
      return Url::fromUserInput('/' . $url_string)->setAbsolute()->toString();
    }
  }

I have created a patch for the 9.5.x release of drupal.

🇬🇧United Kingdom globexplorer

The problem with the above patches is they assume every entity is fieldable, but if not it throws WSOD!

Production build 0.71.5 2024