# As a developer I want to be able to apply patches and upgrade mautic/core within the existing composer.json

**URL:** https://forum.mautic.org/t/as-a-developer-i-want-to-be-able-to-apply-patches-and-upgrade-mautic-core-within-the-existing-composer-json/13750
**Category:** Ideas and Feature Requests
**Tags:** completed
**Created:** [April 2, 2020, 9:11am UTC](https://forum.mautic.org/t/as-a-developer-i-want-to-be-able-to-apply-patches-and-upgrade-mautic-core-within-the-existing-composer-json/13750 "2020-04-02T09:11:08Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Nick\_vh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nick_vh/32/2119_2.png) [@Nick\_vh](https://forum.mautic.org/u/Nick_vh)
#### Post date: [April 2, 2020, 9:11am UTC](https://forum.mautic.org/t/as-a-developer-i-want-to-be-able-to-apply-patches-and-upgrade-mautic-core-within-the-existing-composer-json/13750/1 "2020-04-02T09:11:08Z")

</div>

Right now it is not possible to run composer update and update mautic.

For example, in Drupal the command is the following:

`composer update drupal/core --with-dependencies`

Within the current mautic composer.json it is not possible to upgrade mautic. It is, because this is not possible, also not possible to apply patches like this in the composer.json. Not having this makes it very difficult to maintain patches in production. It would also require to disable upgrading within the source code. Our hosting setup doesn’t allow to modify the PHP files from within the application other than the media files. We only want to update using GIT and make sure changes are kept in git. This is the defacto regular workflow that is needed to move this to a QA flow so we can have a flow for updates that is compatible with git and multiple environments. Using Pull Request is fun for development but not an option if you want to work with a stable branch from the original source + a patch that you verified.

```
    "extra": {
            "patches": {
                "mautic/core": {
                    "#8352 Allow custom fields in search for companies": "https://github.com/mautic/mautic/pull/8352.patch"
                }
            }
        }

```

Therefor I suggest we discuss how we can add mautic/core as a new composer package using the type mautic-core, similar as to how Drupal is structured.

Drupal example project structure:

> <https://github.com/drupal/drupal/blob/2b65fb60cd05b4e00dd227ec99d6dfd165b1598a/composer.json>

Important snippet:

```
 "require": {
        "composer/installers": "^1.0.24",
        "drupal/core": "self.version",
        "drupal/core-project-message": "self.version",
        "drupal/core-vendor-hardening": "self.version",
        "wikimedia/composer-merge-plugin": "^1.4"
    },

```

Drupal core composer example:

> <https://github.com/drupal/drupal/blob/2b65fb60cd05b4e00dd227ec99d6dfd165b1598a/core/composer.json>

Important snippet:  
`"type": "drupal-core",`

I tried to make this work using the existing sources but because the project is setup as composer type:project it is not possible to move the app folder somewhere else, nor is it possible to move the vendor folder outside of the docroot without making a fork of the project, causing a split from the authoritative source, which I do not want.

I’m sure that people within Acquia can help to add more feedback here, as what I’m suggesting is quite normal in the Drupal world 🙂

---

_[View the full topic](https://forum.mautic.org/t/as-a-developer-i-want-to-be-able-to-apply-patches-and-upgrade-mautic-core-within-the-existing-composer-json/13750)._
