Account created on 10 November 2009, over 15 years ago
#

Merge Requests

More

Recent comments

🇧🇪Belgium lobsterr

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

🇧🇪Belgium lobsterr

I think, I found the problem and sometimes it was broken for me too. The cause of the problem was in special symbols used directly in CSS:

content: "►";

When aggregation happens, these symbols are not correct encoded. So, the proper way to use UTF codes instead:

content: "\25BA";

I will add fix in the next version of the library.

Thank you for your contribution

🇧🇪Belgium lobsterr

You can do it using additional js code, by manipulation DOM, but most likely we will not implement as part of superfish library, because I don't see any demand

🇧🇪Belgium lobsterr

@gsquirrel as it was mentioned above you can override preprocess functions in your theme and rewrite logic.

🇧🇪Belgium lobsterr

@mistergroove - I have a solution for you in this ticket: Add HTML wrappers to menu item Active

🇧🇪Belgium lobsterr

I have added new configuration options for prefix and suffix of link text.
It can be found under Advance settings => Hyperlinks

🇧🇪Belgium lobsterr

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

🇧🇪Belgium lobsterr

Please feel free to reopen it when you have more details

🇧🇪Belgium lobsterr

I think, this is not a problem of superfish module, but menu_token module.
Menu token module overrides MenuLinkTree class to build the menu tree and replace token.
So, when MenuLinkTreeMenuToken class builds menu tree:
it gets the title like this:

$element['title'] = $link->getTitle();

but in this case we get title from MenuLinkContent class:

  /**
   * {@inheritdoc}
   */
  public function getTitle() {
    // We only need to get the title from the actual entity if it may be a
    // translation based on the current language context. This can only happen
    // if the site is configured to be multilingual.
    if ($this->languageManager->isMultilingual()) {
      return $this->getEntity()->getTitle();
    }
    return $this->pluginDefinition['title'];
  }

As you can see if the content is multilingual, then we take title from the entity and not from plugin definition.
Menu token modules replaces tokens only in the plugin definitions.

To conclude it should be correctly handled on Menu toke side then we will get the right value for a title.

I have just found this!

You can use solution from this ticket: 🐛 Title replacement not working on multi-language site. RTBC

🇧🇪Belgium lobsterr

I have tried to reproduce this issue different ways, but unfortunately I can't. They only thing I noticed, we are missing arrows just a sec and then when CSS is applied they correctly displayed and once it is cached then they appear immediately.

Could you provide more information how to reproduce it?
What version is used and etc. ?

🇧🇪Belgium lobsterr

It is interesting feature, but I am afraid, not a top priority for the moment. I will try to investigate it later. I am just afraid it could be super buggy

🇧🇪Belgium lobsterr

Guys, Could you provide me more info, what we expect here for me it works as expected.

So, I have created such taxonomy structure for my menu and then recreated these items in my menu.

- Parent 1
- - Child 1
- - Child 1.1
- Parent 2
- - Child 2
- - Child 2.2

For example, when I click on Parent 1, it keeps open only subtree of Parent 1 and for example for child1 the same thing.

I just want to understand, what do we need
1) to update documentation about it
2) to update the logic
3) Nothing, because "Path Level" does the trick?

🇧🇪Belgium lobsterr

Unfortunately, there is no easy way to do it with current implementation of the library and we are not going to implement it.

🇧🇪Belgium lobsterr

Unfortunately, superfish doesn't use standard way to render menu. That is why we don't respect preprocess hooks, but I found the way to handle it, we will use manipulators to alter the menu tree this way it will work only if module enabled.
I ave already transfer the logic from translatable_menu_link_uri module to manipulator, It does a trick

🇧🇪Belgium lobsterr

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

🇧🇪Belgium lobsterr

@pooja_sharma

The last release have already fixed the name of the VERSION file. so, we don't need to do what you propose.

https://github.com/LOBsTerr/drupal-superfish/commits/2.3.8

Current release requires 2.3.7 version of the library and it was fixed already there

https://git.drupalcode.org/project/superfish/-/blame/8.x-1.x/composer.js...

Update the library and it should work

🇧🇪Belgium lobsterr

@greatmatter which version are you using, could you share configuration of the block ?
I will try to check it one more time locally

🇧🇪Belgium lobsterr

For it looks like a cache issues. So far we did a lot of testing of different features, I have never seen it

🇧🇪Belgium lobsterr

As far as I remember we had this issue, because of this bug:

https://github.com/LOBsTerr/drupal-superfish/issues/1

🇧🇪Belgium lobsterr

Thank you for your contribution

🇧🇪Belgium lobsterr

Tried to reproduce it on the different themes with settings without any success. Could you provide more context maybe ?
Drupal version, theme?

🇧🇪Belgium lobsterr

It looks like, this block of css there for ages, but it doesn't solve the issue.
I really don't understand why we need float: left for ul.sf-menu, which actually main source of the issue. I will drop it.

🇧🇪Belgium lobsterr

1) Since, we have already made manipulators alterable Make menu tree manipulators alterable Needs review , it is already possible to add it on your modules
2) I wanted to add a solution from #2 to the module by default, but since there is work in progress and they are changing the names of methods. I am not going to include
3) I like the approach to pass tree to a hook too, because Allow MenuLinkTree manipulators to be altered Needs work they also pass $tree to the event. So, let's add it too, but I propose to pass in the end to keep backward compatibility.

function my_module_superfish_manipulators_alter(array &$manipulators, $menu_name= NULL, &$tree = []) {
  if ($menu_name == 'main') {
    $manipulators[] = ['callable' => 'menu.language_tree_manipulator:filterLanguage'];
  }
}
🇧🇪Belgium lobsterr

Actually, it is a bug, we don't check accessibility of children, that is why children are displayed and we have menuparent class. I have done necessary changes.

🇧🇪Belgium lobsterr

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

🇧🇪Belgium lobsterr

We can't reproduce it. Could check it again? Maybe it was fixed in other issues ot provide more details which version of bootstrap, superfish and drupal is used

🇧🇪Belgium lobsterr

Unfortunately, my approach will have a blinking side effect for normal resolutions.
I have an idea, to render accordeon or select menus for the small screens and show/hide them using media queries, but it will take a lot of time to implement and there could be potential bugs :(

🇧🇪Belgium lobsterr

It looks like in the latest version it works exactly like this, please feel free to reopen it and provide more details, if it is still the case for you

🇧🇪Belgium lobsterr

Does anyone can provide more information how did it work on Drupal 7 version ?
1) There were kind of icons like arrows (what we have now) and on click it would open submenus ?
2) Or we completely disable parent link and handle onclick event to open submenus ?
3) Something else ?

🇧🇪Belgium lobsterr

Thank you for contribution the file Version was restored a new realease of library is tagged

🇧🇪Belgium lobsterr

I think these classes can be useful by default and we don't need config to enable/disable it.
The only thing I added prefix sf: sf-first, sf-last.

🇧🇪Belgium lobsterr

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

🇧🇪Belgium lobsterr

I have recently checked many times this. I have create to custom device in google development tools with resolution 768 and 765 and clearly see switch.

🇧🇪Belgium lobsterr

I am not sure what is the problem on your side, but by default the title is always displayed:

As you see I set for my menu description property "SOME DESCRIPTION" and it is correctly displayed:

<a href="/" title="SOME DESCRIPTION" class="is-active sf-depth-1 menuparent" role="menuitem" aria-haspopup="true" aria-expanded="false">subchild</a>

We have 2 options to manipulate title:

1) Disable hyperlink descriptions ("title" attribute) (Default: disabled)

If I check this option I will get the next result:

<a href="/" title="" class="is-active sf-depth-1 menuparent" role="menuitem" aria-haspopup="true" aria-expanded="false">subchild</a>

As you see the title is empty!

2) Insert hyperlink descriptions ("title" attribute) into hyperlink texts. (Default: disabled)

If I check this option I will get the next result:

<a href="/" title="" class="is-active sf-depth-1 menuparent" role="menuitem" aria-haspopup="true" aria-expanded="false">subchild <span class="sf-description">SOME DESCRIPTION</span></a>

as you can see description was added to a text of this link.

Could you explain what is the problem here then?

🇧🇪Belgium lobsterr

After my investigation of many classes which implement MenuLinkInterface

1) MenuLinkInterface expects string

  /**
   * Returns the localized title to be shown for this link.
   *
   * @return string
   *   The title of the menu link.
   */
  public function getTitle();

2) by default menu links are passed through DefaultMenuLinkTreeManipulators class:

$new_tree[(50000 + $instance->getWeight()) . ' ' . $instance->getTitle() . ' ' . $instance->getPluginId()] = $tree[$key];

As you can see in the core nothing special is done with getTitle method result and just a simple string is expected and not array. As a result I get warining:

Warning: Array to string conversion in Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->generateIndexAndSort() (line 245 

From here I can conclude: yes, it works! because conversion of an array to string, but definitely it is not what expected. It is not a bug.

🇧🇪Belgium lobsterr

Thank you for your contribution

🇧🇪Belgium lobsterr

I have tested both "Menu Link Attributes" and "Link Attributes widget". They both have similar functionality.
I see that superfish module correctly uses classes and attributes provided by these modules.
I will close the ticket please feel free to open it, if it doesn't work for you and provide more details

🇧🇪Belgium lobsterr

I think you are looking for this method 'loadByEntity' :

This an example how you can use it.

$group_relationships = GroupRelationship::loadByEntity($term);

foreach($group_relationships  as $group_relationship) {
   $group = $group_relationship->getGroup();
   if ($group->hasPermission('view group_term:tags entity', $account)) {
       // Do something here.
   }
}
🇧🇪Belgium lobsterr

Hi, you need to check if user has permission "view group_term:tags entity" (in this case I have tags taxonomy vocabulary enabled as a plugin in my group type). You can do it like this:

$group->hasPermission('view group_term:tags entity', $account);

The same way you can check any other permissions like edit, delete:

$group->hasPermission('update any group_term:tags entity', $account);
🇧🇪Belgium lobsterr

The problem was solved in this ticket 🐛 Last Enabled Menu Item Shows As Expandable with No Children Active . Thank you for reporting

🇧🇪Belgium lobsterr

Rollbacked changes to add li element item classes. It solves the issue. Thank you for your contribution

🇧🇪Belgium lobsterr

Thank you for your contribution

🇧🇪Belgium lobsterr

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

🇧🇪Belgium lobsterr

Well, probably. it is repo cache issue. I am closing this ticket since it has been fixed in 4.0.4

I just tried to install, everything is fine, clean composer cache too:

Installing dependencies from lock file (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
  - Downloading drupal/entity (1.6.0)
  - Downloading drupal/flexible_permissions (2.0.1)
  - Downloading drupal/group (3.3.4)
  - Downloading drupal/groupmedia (4.0.4)
🇧🇪Belgium lobsterr

You can use this token [group_content:group:title] or [group_relationship:group:title]

🇧🇪Belgium lobsterr

Hi, @rreedy, you are right it was an accident, I haven't finished to work on it :(

🇧🇪Belgium lobsterr

This code comes from group module:

      // This could be in its own decorator, but then it would live in a module
      // of its own purely for field_ui support. So let's keep it here.
      if ($this->moduleHandler->moduleExists('field_ui')) {
        $relationship_type = $this->entityTypeManager()->getStorage('group_relationship_type')->load($relationship_type_id);
        $operations += field_ui_entity_operation($relationship_type);
      }

field_ui_entity_operation comes from field_ui module. Are you sure it is available ?

🇧🇪Belgium lobsterr

I checked also with Group 2.0 and Group media 3.0 and it works as expected

🇧🇪Belgium lobsterr

I tried to reproduce, without success.

1) When we remove the group it calls the next code:

  public static function preDelete(EntityStorageInterface $storage, array $entities) {
    // Remove all relationships from these groups as well.
    foreach ($entities as $group) {
      assert($group instanceof GroupInterface);
      foreach ($group->getRelationships() as $relationship) {
        $relationship->delete();
      }
    }
  }

It will remove all group relationships. What happens on my side and I see that the data also removed from group_relationship_field_data.
Also I noticed that GroupContentAccessControlHandler, it looks like you are using Group 2.0 and groupmedia 3.0. Right ?

🇧🇪Belgium lobsterr

Thank you for your contribution. I have added a fix

🇧🇪Belgium lobsterr

Unfortunately, I can't reproduce this issue, I understand that is a quite old issue, plus we have a lot of changes since then, I will keep it for awhile just to be sure nobody else has it.

🇧🇪Belgium lobsterr

Thank you for your contribution.

I have added a fix in drupal-superfish library, it will be available in the next release.

🇧🇪Belgium lobsterr

Thank you for your contribution

🇧🇪Belgium lobsterr

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

🇧🇪Belgium lobsterr

I will explain how expanded options are working.
1) By default no "Show as expanded" option from a menu item is taking account. It means the menu will be displayed with ALL submenus!
2) In order to take into account any expanded option we need to use "Take "Expanded" option into effect.". In this case we take into account "Show as expanded" and show children if it is checked.
3) I have fixed saving of "Expand all menu links", if this option is checked an option "Show as expanded" of any menu item will be ignored

Production build 0.71.5 2024