SUGAR.mySugar.toggleDashletCategories not working when selecting categories on dashlet v7.9.8 #2607

Closed
opened 2026-02-20 15:26:15 -05:00 by deekerman · 7 comments
Owner

Originally created by @rebbieboi on GitHub (Jan 12, 2018).

Issue

When you add a new dashlet you cannot navigate on the categories as they do nothing when clicked. No console errors.

Expected Behavior

When you navigate on the dashlet categories it should open the tabs for the new categories

Actual Behavior

Clicking on the new categories tab does nothing

Possible Fix

I'm still trying to find the cause of this problem my self. But what seems to work is if you add a dashlet from the default category (Modules) the other categories (Chart, Tools, Web) will become clickable and work as expected but it does not always happen.

Steps to Reproduce

  1. Go to Home page
  2. Add dashlet
  3. Choose any of the categories

Context

This severely limits the usability of the dashlets

Your Environment

  • SuiteCRM Version used: 7.9.8
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome v63 and FF 64bit.
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7, Apache
  • Operating System and version (e.g Ubuntu 16.04): Linux CHELMSFORD-CRM-Test 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64
  • Theme: SuiteP
Originally created by @rebbieboi on GitHub (Jan 12, 2018). <!--- Provide a general summary of the issue in the **Title** above --> <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> #### Issue When you add a new dashlet you cannot navigate on the categories as they do nothing when clicked. No console errors. #### Expected Behavior When you navigate on the dashlet categories it should open the tabs for the new categories #### Actual Behavior Clicking on the new categories tab does nothing #### Possible Fix I'm still trying to find the cause of this problem my self. But what seems to work is if you add a dashlet from the default category (Modules) the other categories (Chart, Tools, Web) will become clickable and work as expected but it does not always happen. #### Steps to Reproduce 1. Go to Home page 2. Add dashlet 3. Choose any of the categories #### Context This severely limits the usability of the dashlets #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.9.8 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Chrome v63 and FF 64bit. * Environment name and version (e.g. MySQL, PHP 7): PHP 7, Apache * Operating System and version (e.g Ubuntu 16.04): Linux CHELMSFORD-CRM-Test 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 * Theme: SuiteP
Author
Owner

@rebbieboi commented on GitHub (Jan 12, 2018):

Found the problem:

The problem was that another element was being created that shares the id name for the categories.

So there are now two elements that have the same ID so the code found on include/MySugar/javascript will not work

Find this block:

        var moduleTab = document.getElementById('moduleCategory');
        var moduleTabAnchor = document.getElementById('moduleCategoryAnchor');
        var moduleListDiv = document.getElementById('moduleDashlets');

        var chartTab = document.getElementById('chartCategory');
        var chartTabAnchor = document.getElementById('chartCategoryAnchor');
        var chartListDiv = document.getElementById('chartDashlets');

        var toolsTab = document.getElementById('toolsCategory');
        var toolsTabAnchor = document.getElementById('toolsCategoryAnchor');
        var toolsListDiv = document.getElementById('toolsDashlets');

        var webTab = document.getElementById('webCategory');
        var webTabAnchor = document.getElementById('webCategoryAnchor');
        var webListDiv = document.getElementById('webDashlets');

Replace with:

                var moduleTab       = $(".modal #moduleCategory")[0];
                var moduleTabAnchor = $(".modal #moduleCategoryAnchor")[0];
                var moduleListDiv   = $(".modal #moduleDashlets")[0];
                var chartTab        = $(".modal #chartCategory")[0];
                var chartTabAnchor  = $(".modal #chartCategoryAnchor")[0];
                var chartListDiv    = $(".modal #chartDashlets")[0];
                var toolsTab        = $(".modal #toolsCategory")[0];
                var toolsTabAnchor  = $(".modal #toolsCategoryAnchor")[0];
                var toolsListDiv    = $(".modal #toolsDashlets")[0];
                var webTab          = $(".modal #webCategory")[0];
                var webTabAnchor    = $(".modal #webCategoryAnchor")[0];
                var webListDiv      = $(".modal #webDashlets")[0];

I have no idea what that is for but if there is a better approach here please let me know so that I can apply it.

Thank you

@rebbieboi commented on GitHub (Jan 12, 2018): Found the problem: The problem was that another element was being created that shares the id name for the categories. So there are now two elements that have the same ID so the code found on **include/MySugar/javascript** will not work Find this block: ``` var moduleTab = document.getElementById('moduleCategory'); var moduleTabAnchor = document.getElementById('moduleCategoryAnchor'); var moduleListDiv = document.getElementById('moduleDashlets'); var chartTab = document.getElementById('chartCategory'); var chartTabAnchor = document.getElementById('chartCategoryAnchor'); var chartListDiv = document.getElementById('chartDashlets'); var toolsTab = document.getElementById('toolsCategory'); var toolsTabAnchor = document.getElementById('toolsCategoryAnchor'); var toolsListDiv = document.getElementById('toolsDashlets'); var webTab = document.getElementById('webCategory'); var webTabAnchor = document.getElementById('webCategoryAnchor'); var webListDiv = document.getElementById('webDashlets'); ``` Replace with: ``` var moduleTab = $(".modal #moduleCategory")[0]; var moduleTabAnchor = $(".modal #moduleCategoryAnchor")[0]; var moduleListDiv = $(".modal #moduleDashlets")[0]; var chartTab = $(".modal #chartCategory")[0]; var chartTabAnchor = $(".modal #chartCategoryAnchor")[0]; var chartListDiv = $(".modal #chartDashlets")[0]; var toolsTab = $(".modal #toolsCategory")[0]; var toolsTabAnchor = $(".modal #toolsCategoryAnchor")[0]; var toolsListDiv = $(".modal #toolsDashlets")[0]; var webTab = $(".modal #webCategory")[0]; var webTabAnchor = $(".modal #webCategoryAnchor")[0]; var webListDiv = $(".modal #webDashlets")[0]; ``` I have no idea what that is for but if there is a better approach here please let me know so that I can apply it. Thank you
Author
Owner

@PedroErnst commented on GitHub (Jan 15, 2018):

Hello @rebbieboi , thanks for reporting this issue.

I'm going to need your help here because I'm not able to replicate the problem.
Are you using any kind of add-ons or custom modules which could be causing this conflict?

In principle the solution for this problem is to eliminate duplicate ids. Ids should be unique in the DOM, anything else is bound to produce undefined behavior at some point.

@PedroErnst commented on GitHub (Jan 15, 2018): Hello @rebbieboi , thanks for reporting this issue. I'm going to need your help here because I'm not able to replicate the problem. Are you using any kind of add-ons or custom modules which could be causing this conflict? In principle the solution for this problem is to eliminate duplicate ids. Ids should be unique in the DOM, anything else is bound to produce undefined behavior at some point.
Author
Owner

@rebbieboi commented on GitHub (Jan 16, 2018):

This is the element that copies the dashlet modal with ID's:

<div class="yui-panel-container yui-dialog shadow" id="dashletsDialog_c" style="visibility: visible; left: 957px; top: 295px; z-index: 4;"><div id="dashletsDialog" style="visibility: inherit; width: 480px; height: 520px;" class="yui-module yui-overlay yui-panel">

This is the dashlet modal:

<div class="modal fade modal-add-dashlet in" tabindex="-1" role="dialog" style="display: block; padding-right: 12px;">

I just started working on this project so I'm not sure if they had some plugins installed.

I hope this helps you out. 👍

@rebbieboi commented on GitHub (Jan 16, 2018): This is the element that copies the dashlet modal with ID's: `<div class="yui-panel-container yui-dialog shadow" id="dashletsDialog_c" style="visibility: visible; left: 957px; top: 295px; z-index: 4;"><div id="dashletsDialog" style="visibility: inherit; width: 480px; height: 520px;" class="yui-module yui-overlay yui-panel">` This is the dashlet modal: `<div class="modal fade modal-add-dashlet in" tabindex="-1" role="dialog" style="display: block; padding-right: 12px;">` I just started working on this project so I'm not sure if they had some plugins installed. I hope this helps you out. :+1:
Author
Owner

@PedroErnst commented on GitHub (Jan 18, 2018):

Thanks, I'm still not able to reproduce this. We will keep looking into it.

@PedroErnst commented on GitHub (Jan 18, 2018): Thanks, I'm still not able to reproduce this. We will keep looking into it.
Author
Owner

@PedroErnst commented on GitHub (Jun 22, 2018):

@Dillon-Brown should this still be marked as a High Priority?

A) It's a now unsupported version
B) It's been reported by a single user once, and not been reproduced as far as I can tell

@PedroErnst commented on GitHub (Jun 22, 2018): @Dillon-Brown should this still be marked as a High Priority? A) It's a now unsupported version B) It's been reported by a single user once, and not been reproduced as far as I can tell
Author
Owner

@pgorod commented on GitHub (Jun 22, 2018):

I think we should just close it, and when @rebbieboi upgrades to 7.10.x he can reopen it, if the issue is still present, but only if he can confirm that there are no add-ons in his system that could be causing this conflict.

@pgorod commented on GitHub (Jun 22, 2018): I think we should just close it, and when @rebbieboi upgrades to 7.10.x he can reopen it, if the issue is still present, but only if he can confirm that there are no add-ons in his system that could be causing this conflict.
Author
Owner

@rebbieboi commented on GitHub (Jun 22, 2018):

I'll just close this since my temp fix is working fine. :) I'm sure you have bigger problems to deal with anyway.

@rebbieboi commented on GitHub (Jun 22, 2018): I'll just close this since my temp fix is working fine. :) I'm sure you have bigger problems to deal with anyway.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#2607
No description provided.