This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Modify body markup for display only

I am porting a D7 module that i want to release for D8. 

The module injects a block that you can select into the body. The problem i have is that i achived to manipulate the body field and save it, BUT it is really saved to the DB not only for the display. That is very bad as i only want the injection to be happen at display withoput changing the original body content.

Because of forUpdate facing issue with query on slave

 protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {

    $query = parent::buildQuery($ids, $conditions, $revision_id);

    if ($this->pessimisticLocking && isset($this->entityInfo['locking mode']) && $this->entityInfo['locking mode'] == 'pessimistic') {

      // In pessimistic locking mode, we issue the load query with a FOR UPDATE

      // clause. This will block all other load queries to the loaded objects

      // but requires us to start a transaction.

Converting/Upgrading a Drupal 8 module to 9 (not using Drush)

Hey there, 

I did a quick search and couldn't find much about upgrading/updating modules to Drupal 9. I'm sorry if I missed it, please just point me to right direction. 

Long time Drupal user (5.x was my first experiment with Drupal and I've been on Drupal since the early days of 6 - not using Drush - yet ).

I need some guidance about Drupal 8.x modules/themes upgrading to Drupal 9.

I'm ready to move on to Drupal 9 (currently 8.9) but my theme and slider are not compatible (or at least, have not been updated for 9). Suggestions?

Accessing an object's :protected value

I am trying to retrieve an object's protected key/value

How can I get the menu ui link from a node?

I'm trying to get a specific menu link to a node but we have a giant menu structure with more than one link to the same node.

$menu_links = $menu_link_service->loadLinksByRoute('entity.node.canonical', $route_params, $menu_name);

This code works but $menu_links sometimes has multiple links.  The Menu UI module somehow keeps track of only a single menu link even if there are multiple links in the same menu to that node. I'm calling this the menu ui link, though maybe there's a better way to refer to it.

system_retrieve_file() not working correct

Hello Everyone, 

when I'm calling system_retrieve_file like:

$thumbnail = system_retrieve_file($thumbnail_url, NULL, TRUE, FileSystemInterface::EXISTS_REPLACE);

It will download the image into file system but when I try to print $thumbnail object it will have empty fid (file id). 

Note: when I ran the same code again with the same thumbnail url, it gave me the fid. 

Not sure why at first place fid is empty. 

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions