How to install Acquia's Custom Objects plugin?

Check the admin menu first (right side)

1 Like

@joeyk :smiley:

When I was very very young and started off in the hi-tech world I was always quoted with RTFM…

Read The &*())&& Manual. I should have remembered this.

I looked for the menu for 1 hour before I found it. :smiley:
Mautic made me a better person: patience, resilience, scrutiny.

(Then I posted in the forums about lack of API docs. Made fool of myself. You can find it in the plugin’s wiki page :smiley: )

J

So back at this again.

We have an install that we just upgraded to 4.3.1 and I went ahead and followed the directions as explained above by @gary.harrison - Thanks!!

These directions worked very well for me on a clean install, however here I am getting an 500 Internal Error " Uh oh! I think I broke it. If I do it again, please report me to the system administrator!" message after installing the plugin and also with adding the PR mentioned by @escopecz .

I have looked to see if I can see any logs in mautic.error - nothing showing up on tail there.

I have made sure to chown the entire directory.
Cleared the cache.
Ran the command:

php console mautic:plugins:install
0 new plugins were installed and 0 updated.

Where else can I look to debug this ?

I basically re-ran the plugin:install again and it all worked!

3 Likes

Thx for sharing the solution here, this is great help for others!

Tried installing this now on latest manual install of 4.4.4 and got the following error:

HP Fatal error:  Uncaught Error: Interface 'Mautic\CoreBundle\Entity\UpsertInterface' not found in /var/www/ams/plugins/CustomObjectsBundle/Entity/CustomItem.php:45
Stack trace:
#0 /var/www/ams/vendor/composer/ClassLoader.php(571): include()
#1 /var/www/ams/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#3 [internal function]: spl_autoload_call()
#4 /var/www/ams/app/bundles/CoreBundle/DependencyInjection/Builder/Metadata/EntityMetadata.php(55): ReflectionClass->__construct()
#5 /var/www/ams/app/bundles/CoreBundle/DependencyInjection/Builder/BundleMetadataBuilder.php(164): Mautic\CoreBundle\DependencyInjection\Builder\Metadata\EntityMetadata->build()
#6 /var/www/ams/app/bundles/CoreBundle/DependencyInjection/Builder/BundleMetadataBuilder.php(158): Mautic\CoreBundle\DependencyInjection\Builder\BundleMetadataBuilder->buildMappings()
#7 /var/www/ams/app/bundles/CoreBundle/DependencyInjection/Builder/BundleMetadataBuilder.php(116): Mautic\Cor in /var/www/ams/plugins/CustomObjectsBundle/Entity/CustomItem.php on line 45

Any ideas?

I could be wrong here… but try installing mautic dev dependencies.

Sorry about this. The plugin is developed by Acquia that have different release cycle than the community. You have to manually insert this new class:

or wait for Mautic 5 release. That PR could be also cherry-picked to a new pull request for Mautic 4 if someone would want support for Mautic 4.

Maybe we can add to 4.4.5 ?

I asked the author of the PR to create the PR for M4 too.

1 Like

Hi @escopecz thanks for jumping in here.

So I have gone ahead and done the following:

  1. Amended the file CommonRespository.php
  2. Created the two new files UpsertInterface.php and UpsertTrait.php
  3. I created phpstan.neon in the mautic root directory.

Reinstalled the plugin and seems to have worked and got installed.

Appreciate this.

And the author prepared the PR for Mautic 4. I’ve made a review and will be merging it shortly. So Mautic 4.4.5 will support the latest Custom Objects plugin version.

Amazing :smiley:

Hi,

I just installed 4.4.5 and installed custom objects - worked perfectly without any tweaking or patching.

Thanks!!

1 Like

After having installed on 4.4.5 seamlessly I am trying to run some API calls and I see that the actual call is executing the desired result, however I am getting a 500 error back in response:

This is the error I am seeing:

2022/12/19 12:45:07 [error] 47597#47597: *10668 FastCGI sent in stderr: "PHP message: PHP Warning:  get_class() expects parameter 1 to be object, int given in /var/www/mautic/vendor/doctrine/orm/lib/Doctrine/ORM/Query/Expr/Base.php on line 73" while reading response header from upstream, client: 199.99.99.99, server: mymauitc.com, request: "PATCH /api/contacts/13/edit?includeCustomObjects=true HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "mymauitc.com"

And in the access log:

138.68.137.203 - apiuser [19/Dec/2022:12:45:07 +0000] "PATCH /api/contacts/13/edit?includeCustomObjects=true HTTP/1.1" 500 172 "-" "axios/0.21.4"

And my object looks like this:

{ "customObjects": { "data": [{ "id": 1,"alias": "deposits", "data": [{ "id":"8", "name": "Deposit-DateInputHere", "attributes": { "deposit-date1": "2022/12/29", "deposit-currency": "USD" ,"deposit-amount":"9000", "deposit-brand":"Surge"}}]}] } }

But like I say the object is actually created correctly inside Mautic.

Any ideas ?

Added Test: I just set up the exact same custom object and fields in 4.4.5 and ran the same API call and I am getting the 500 error, whereas on 4.4.4 it returns a success.

Further testing: I thought maybe it was something in the code integration so I went ahead and tried to apply the files from the original patch, however still getting the same behaviour…

Has anyone else use the API with 4.4.5 and had better experience ?

another scary thing I just encountered (even though on a testing environment) is when I go into the custom objects and delete them all, it actually deletes the contact details as well. So for example this lead_id 13, had a Firstname, Lastname, Email address along with other fields, and now it is anonymous :confused:

Hello all,

I’m running into a lot of similar problems as mentioned in this topic. I’m on Mautic 4.4.10, with ubuntu 22.04, php 8.0… I’m not using composer, is that a problem? I read some people are able to use the plugin, but I can’t get it to work.

I followed the steps mentioned by @gary.harrison. As soon as I upload the CustomObjectsBundle folder and run the mautic:plugins:install command it says “0 new plugins were installed and 0 updated.”

When I try to clear the cache I get an error "In SegmentFiltersMergeSubscriber.php line 27:

Undefined constant Mautic\LeadBundle\LeadEvents::LIST_FILTERS_MERGE"

It’s 2024 already and there’s been several new mautic releases so I would think it shouldn’t be so much trouble anymore. I don’t know if I’m missing some obvisious steps, or maybe there is a tutorial I haven’t found. But can someone help me?

Which branch have you downloaded?

I used the URL from the zip file you get under the green download button on GitHub - acquia/mc-cs-plugin-custom-objects: Mautic plugin adding Custom Objects feature, so the staging branch.