Hubspot Mapping Error

Your software
My Mautic version is: 4.4.3
My PHP version is: 7.4
My Database type and version is: MySQL 8

Your problem
My problem is: When editing the Hubspot Field Mapping in Plugins, going to the next page of fields causes the Contact Mapping tab to disappear and the next page to not appear on the screen.

These errors are showing in the log: No errors are being displayed. The API returns a successful message in Chrome Dev Tools.

Steps I have tried to fix the problem: I have not tried to alter the code as I do not want to break the syncing that is currently working properly.

Same here. the underlying http request returns {“success”:0} and there is nothing in the log.

@steverobinson @marc.beinder

if you turn the debug mode on by editing app/config/local.php:

‘debug’ => true

is there any additional info that provides clue as to what is actually happening?

I’m afraid not. When I enable debug, I get a very verbose output for the load of the initial screen where all the field metadata for hubspot is logged. But if I tail the log while clicking on the pagination controls at the bottom, nothing is appended. No debug info, no errors. And the network request shows a 200 response with {“success”:0} still.

@marc.beinder @mzagmajster I also upgraded to 4.4.4 just in case PR 11416 made a difference. It didn’t. Still nothing in the logs when I try to paginate and still {“success”:0} response to the browser.

@steverobinson I’m not familiar with the Mautic source code, but is it possible that PR 11416 could be the cause of this issue?

@marc.beinder I have a fix, but I’m not good at git/submitting PRs at this time so I’ll post the code here and maybe @mzagmajster or someone else could whip up a PR in the future (or fix it the right way?).

If you edit lines 34-37 of app/bundles/PluginBundle/Controller/AjaxController.php from:

        $integration = $request->request->get('integration');
        $settings    = $request->request->get('settings');
        $page        = $request->request->get('page');

To:

        $integration = $request->query->get('integration');
        $settings    = $request->query->get('settings');
        $page        = $request->query->get('page');

it should start working. It’s been a VERY long time since I’ve been an active PHP developer, so I have no idea why the last person used request instead of query and what I might be doing wrong using query instead of request, but at least I have it working and can get my work done today.

I can’t guarantee this also doesn’t break other plugin screens, so remember this if you can’t update settings for another plugin.

1 Like

Thank you! I’ll give this a shot as soon as I am able. If it works I’ll try to get a PR written up. Users should not wait up on me though as I may not be able to get to this for a while.

Would be awesome to get a fix made for this - @steverobinson @mzagmajster @biozshock would you be open to making the PR if @marc.beinder hasn’t got capacity?

Sorry I have not gotten to this yet. Got some personal things going on. I also just made a post about Hubspot sunsetting API Keys in favor of their new Private App offering. This is something that we’ll need to migrate to shortly since this will be going into effect November 30th 2022. I’m not familiar enough with the Mautic codebase to make this migration myself, otherwise I would do it and PR it.

I just signed the contributor agreement and submitted a PR for the Hubspot mapping issue. This PR does not address the Hubspot API vs Hubspot Private App issue. @rcheesley

1 Like

Yeah that issue is already being dealt with in a separate PR: Fix/change hubspot api auth by npracht · Pull Request #11470 · mautic/mautic · GitHub

1 Like