Problem/Motivation

This module needed some work the current latest version had multiple issues resulting in a now working condition. This patch fixes these issues and makes the module drupal 9 compatible.

Steps to reproduce

Try to install latest version the sdk will fail because it no longer exists.

Proposed resolution

Merge this patch (mr) into the module to fix all the remaining issues. Also fixed the entire module based on PHPSTAN and drupal coding standards.

Remaining tasks

Upgrade to a new sdk version in the future.

User interface changes

None

API changes

Added better optimalisation for the zoho crm integration multiple countries now there was also a bug with the eu version of the API.

Data model changes

None

CommentFileSizeAuthor
drupal-9-phpstan-and-issues.patch22.45 KBremco hoeneveld
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Remco Hoeneveld created an issue. See original summary.

tido’s picture

Hi,

Can you tell me more about your test scenario? I'm trying to run this module with the patch provided on a LAMP stack composed of PHP 8 and Drupal 9, still on the 2.0.1 version of the Zoho SDK (so by forking the module), but I always get an error:

Error: mysqli object is already closed in /app/vendor/zohocrm/php-sdk-archive/src/oauth/persistence/ZohoOAuthPersistenceHandler.php on line 59

I would like to know if you have ever encountered this error?

remco hoeneveld’s picture

Hi,

I did not encounter this error. Could you give me some more information about why this happens? It look like there is something wrong with the database connection or with the way of getting the information from the database? In my scenario this does not occure.

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

gilmord’s picture

Hi

I see this issue is also fixing this one (use archive SDK):
https://www.drupal.org/project/zoho_crm_integration/issues/3185962

And once it has global fixes - I pushed a commit to fix this one (update SDK version):
https://www.drupal.org/project/zoho_crm_integration/issues/3264682

I used 2.0.6 as it is the closest to previous version and contains a fix for the critical issue.

dieuwe’s picture

I get an "Invalid OAuth scope to access this URL" error when using this patch/branch with the default COM domain.

gilmord’s picture

hi @dieuwe

using the patch of this issue may be useless as it contains changes to composer.json of the module.
You have to install the module from the issue fork with updated requirements in the global composer.json of your project,
or download the fork code to the custom modules directory and require the correct SDK version manually.

dieuwe’s picture

This is with the composer changes and 2.0.6 of the archive SDK. When EU is selected, I get redirected to the EU login (I don't have an EU account to test further). When COM is selected, I get a scope error.

Taking just the composer changes (including the override to get past the error on the config page) and the OAuth connection works with the default COM option. Perhaps it would be good to check if someone has a working COM set up with all the changes in this branch?

It might be good to split out the composer and SDK issues from this one and get that committed first to make it easier for people to test other changes in isolation.

adrianopulz’s picture

Hi there! Thanks for all the help fixing these issues related to the SDK updates.

I've merged the changes from this Fork on current Dev branch (8.x). I'll create a 2.x version of this module that will work with the current updated SDK (https://github.com/zoho/zcrm-php-sdk) on version 3.1.0 (https://packagist.org/packages/zohocrm/php-sdk).

adrianopulz’s picture

Hi there! I've added the beta2 version including all the fixes from this issue. @dieuwe, I've worked on the issue about the scope error in this version, it was related to a problem getting the Config Form selected scopes. The getAuthorization method was sending all available scopes instead of just the selected ones on the configuration page.

The latest php-sdk-archive package version is 2.2.1 from September 2020. The dev branch is using this version instead of 2.0.6.

I believe we can close this ticket. Let me know if you have anything else on this issue.

anybody’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.