Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular error breaks activity tab page #879

Open
allinappliadmin opened this issue Oct 27, 2022 · 8 comments
Open

Angular error breaks activity tab page #879

allinappliadmin opened this issue Oct 27, 2022 · 8 comments

Comments

@allinappliadmin
Copy link

We ran the fork from @bgm for WP on different recent versions of CiviCRM (now on 5.54) with the necessary plugins and configuration and trying to access the activity tab breaks the tab and blocks the instance.

https://www.loom.com/share/e64939e649d446578144fd79e3a2c826

We've already spent hours trying to debug: deactivate all extensions, activate them one by one, change php version, upgrade and downgrade versions of CiviCRM, update extension, ask @bgm to investigate, migrate to a new website... It crashes the instance, blocks the browser and even froze the computer.

All errors are related to angular.js file:

Possibly unhandled rejection: {"readyState":4,"responseText":"<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body>\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n","status":504,"statusText":"Gateway Timeout"}

TypeError: contactObj is null
    Angular 23
    jQuery 5
 Possibly unhandled rejection: {} angular.js:15697:15
    Angular 23
    jQuery 5

InternalError: too much recursion
    Angular 7
angular.js:15697:15

and especially this line: return Function.prototype.apply.call(logFn, console, args);

I can provide credentials to see the issue live.

I read that the extension is supposed to work only with 5.39 but on versions such as the 5.49 it was working.

Have you noticed such an issue

@mlutfy
Copy link

mlutfy commented Nov 7, 2022

I did a bit of digging on this issue, and it seems to be specific to WordPress. I tested on CiviCRM 5.55 with Drupal7, both the original Compucorp version and our fork, and that worked fine.

One potential lead: if we patch civicrm/templates/CRM/common/TabHeader.js, around line 23, to remove this lINE:

      .on('tabsactivate', function(e, ui) {
        var tabId = ui.newTab.attr('id');
        if (tabId && tabId.length) {
          tabId = tabId.slice(4); // Remove leading 'tab_'
          // history.replaceState(null, '', updateUrlParameter('selectedChild', tabId));  // <-------  comment out
        }
      })

then the problem seems to go away.

selectedChild a useful feature though, so the above is just a temporary workaround.

@allinappliadmin
Copy link
Author

it seems that it solved on WP (exact path is plugins/civicrm/civicrm/templates/CRM/common/TabHeader.js)
awaiting for client's feedback but it looks great :-)

@mlutfy
Copy link

mlutfy commented Nov 8, 2022

A very weird discovery (without the selectedChild workaround):

  • open a contact page
  • add #/? at the end of the URL (and hit 'enter')
  • then click on a tab

And everything works fine ... edit: except the activities tab.

Other random findings: loading the Membership tab initializes CiviCase because of this, I think:

image

@allinappliadmin
Copy link
Author

:-| strange indeed

@allinappliadmin
Copy link
Author

same issue and fix on 5.56beta1

@mlutfy
Copy link

mlutfy commented Nov 9, 2022

@allinappliadmin It's unlikely to be fixed by core. I had to stop debugging because I was turning in circles. For now we are applying the TabHeader.js fix on our builds.

@Guydn
Copy link

Guydn commented Nov 10, 2022

With the patch, i am not able to open the activity from the list of activities. @mlutfy

@Guydn
Copy link

Guydn commented Nov 10, 2022

An interesting workaround is a search kit / form on activities, as a tab in the contact summary. It is possible to expose filters and I think it could be a very good option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants