# How to install Acquia's Custom Objects plugin?

**URL:** <https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204>\
**Category:** 3rd Party Addons\
**Created:** [May 24, 2022, 2:00pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204 "2022-05-24T14:00:10Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 14, 2022, 7:47am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/41 "2022-06-14T07:47:50Z")

</div>

Check the admin menu first (right side)

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [June 14, 2022, 7:51am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/42 "2022-06-14T07:51:05Z")

</div>

@joeyk 😃

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 14, 2022, 7:53am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/43 "2022-06-14T07:53:49Z")

</div>

I looked for the menu for 1 hour before I found it. 😃  
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 😃 )

J

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [June 27, 2022, 7:32am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/44 "2022-06-27T07:32:51Z")

</div>

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:

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

```

Where else can I look to debug this ?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [June 27, 2022, 8:18am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/45 "2022-06-27T08:18:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [June 27, 2022, 8:24am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/46 "2022-06-27T08:24:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [November 23, 2022, 5:30pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/47 "2022-11-23T17:30:47Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [November 23, 2022, 7:25pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/48 "2022-11-23T19:25:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [November 24, 2022, 9:05am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/49 "2022-11-24T09:05:39Z")

</div>

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:

> <https://github.com/mautic/mautic/pull/11654>
>
> \<!-- ## Which branch should I use for my PR?
> 
> Assuming that:
> 
> a = current ma…jor release
> b = current minor release
> c = future major release
> 
> \* a.x for any features and enhancements (e.g. 5.x)
> \* a.b for any bug fixes (e.g. 4.4, 5.1)
> \* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) --\>
> 
> | Q | A
> | -------------------------------------- | ---
> | Bug fix? (use the a.b branch) | \[No \]
> | New feature/enhancement? (use the a.x branch) | \[\]
> | Deprecations? | \[\]
> | BC breaks? (use the c.x branch) | \[\]
> | Automated tests included? | \[No\] 
> | Related user documentation PR URL | mautic/mautic-documentation#... 
> | Related developer documentation PR URL | mautic/developer-documentation#... 
> | Issue(s) addressed | Fixes https://github.com/acquia/mc-cs-plugin-custom-objects/issues/288
> 
> \<!--
> Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
> - Always add tests and ensure they pass.
> - Bug fixes must be submitted against the lowest maintained branch where they apply
> (lowest branches are regularly merged to upper ones so they get the fixes too.)
> - Features and deprecations must be submitted against the "4.x" branch.
> \--\>
> 
> \#### Description:
> 
> \<!--
> \--\>
> This PR adds the ability to 'upsert' an entity using 'INSERT INTO ... VALUES ... ON DUPLICATE KEY UPDATE' query. It also adds methods to check if the entity has been updated or inserted. 
> 
> \#### Steps to test this PR:
> 
> \<!--
> This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
> \--\>
> 1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs \[here\](https://contribute.mautic.org/contributing-to-mautic/tester))
> 2. See https://github.com/acquia/mc-cs-plugin-custom-objects/issues/288
> 
> \<!--
> If you have any deprecations, list them here along with the new alternative.
> If you have any backwards compatibility breaks, list them here.
> \--\>
> 
> 
> \<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/11654"\>\<img src="https://gitpod.io/button/open-in-gitpod.svg"/\>\</a\>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [November 24, 2022, 9:09am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/50 "2022-11-24T09:09:38Z")

</div>

Maybe we can add to 4.4.5 ?

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [November 24, 2022, 9:23am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/51 "2022-11-24T09:23:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [November 24, 2022, 12:01pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/52 "2022-11-24T12:01:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)\
**Post date:** [November 24, 2022, 3:06pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/53 "2022-11-24T15:06:32Z")

</div>

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.

> <https://github.com/mautic/mautic/pull/11746>
>
> \<!-- ## Which branch should I use for my PR?
> 
> Assuming that:
> 
> a = current ma…jor release
> b = current minor release
> c = future major release
> 
> \* a.x for any features and enhancements (e.g. 5.x)
> \* a.b for any bug fixes (e.g. 4.4, 5.1)
> \* c.x for any features, enhancements or bug fixes with backward compatibility breaking changes (e.g. 5.x) --\>
> 
> | Q | A
> | -------------------------------------- | ---
> | Bug fix? (use the a.b branch) | \[\]
> | New feature/enhancement? (use the a.x branch) | \[\]
> | Deprecations? | \[\]
> | BC breaks? (use the c.x branch) | \[\]
> | Automated tests included? | \[\] 
> | Related user documentation PR URL | mautic/mautic-documentation#... 
> | Related developer documentation PR URL | mautic/developer-documentation#... 
> | Issue(s) addressed | Fixes #11654 https://github.com/mautic/mautic/pull/11654#issuecomment-1326170804
> 
> \<!--
> Additionally (see https://contribute.mautic.org/contributing-to-mautic/developer/code/pull-requests#work-on-your-pull-request):
> - Always add tests and ensure they pass.
> - Bug fixes must be submitted against the lowest maintained branch where they apply
> (lowest branches are regularly merged to upper ones so they get the fixes too.)
> - Features and deprecations must be submitted against the "4.x" branch.
> \--\>
> 
> \#### Description:
> 
> \<!--
> Please write a short README for your feature/bugfix. This will help people understand your PR and what it aims to do. If you are fixing a bug and if there is no linked issue already, please provide steps to reproduce the issue here.
> \--\>
> Contains cherry picked commits from https://github.com/mautic/mautic/pull/11654
> See: https://github.com/mautic/mautic/pull/11654#issuecomment-1326170804
> 
> \#### Steps to test this PR:
> 
> \<!--
> This part is really important. If you want your PR to be merged, take the time to write very clear, annotated and step by step test instructions. Do not assume any previous knowledge - testers may not be developers.
> \--\>
> 1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs \[here\](https://contribute.mautic.org/contributing-to-mautic/tester))
> 2. 
> 
> \<!--
> If you have any deprecations, list them here along with the new alternative.
> If you have any backwards compatibility breaks, list them here.
> \--\>
> 
> 
> \<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/11746"\>\<img src="https://gitpod.io/button/open-in-gitpod.svg"/\>\</a\>

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [November 24, 2022, 3:35pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/54 "2022-11-24T15:35:43Z")

</div>

Amazing 😃

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [December 11, 2022, 6:21pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/55 "2022-12-11T18:21:59Z")

</div>

Hi,

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

Thanks!!

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [December 19, 2022, 12:48pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/56 "2022-12-19T12:48:13Z")

</div>

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:

```auto
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:

```auto
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:

```auto
{ "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 ?

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [December 19, 2022, 12:54pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/57 "2022-12-19T12:54:02Z")

</div>

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 😕

---

<div class="post-metadata">

**Author:** ![klaasvna](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/klaasvna/32/957_2.png) [@klaasvna](https://forum.mautic.org/u/klaasvna)\
**Post date:** [February 4, 2024, 11:24am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/58 "2024-02-04T11:24:31Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [February 4, 2024, 5:01pm UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/59 "2024-02-04T17:01:45Z")

</div>

Which branch have you downloaded?

---

<div class="post-metadata">

**Author:** ![klaasvna](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/klaasvna/32/957_2.png) [@klaasvna](https://forum.mautic.org/u/klaasvna)\
**Post date:** [February 5, 2024, 7:48am UTC](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204/60 "2024-02-05T07:48:22Z")

</div>

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](https://github.com/acquia/mc-cs-plugin-custom-objects), so the staging branch.

[Previous page](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204.md?page=2)

[Next page](https://forum.mautic.org/t/how-to-install-acquias-custom-objects-plugin/24204.md?page=4)
