Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 5.x #338

Merged
merged 333 commits into from
Jan 13, 2025
Merged

Update to 5.x #338

merged 333 commits into from
Jan 13, 2025

Conversation

volha-pivavarchyk
Copy link

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 #...

Description:

Replaces PRs #298, #308, #316

Steps to test this PR:

  1. Open this PR for testing locally (see docs on testing PRs here)

dongilbert and others added 30 commits November 13, 2023 13:50
Fixes for PHPStan & PHP CS Fixer
Remove PUT from the available item operations for the custom_objects endpoint
MAUT-11028 : fix segement filter issue in custom object
Co-authored-by: Saurabh Gupta <[email protected]>
MAUT-10983 : fix for custom item PATCH request is working same as PUT call
@iuriJorbenadze
Copy link

Simplified Guide: Installing Custom Objects Plugin for Mautic 5.1.1
This guide helps you set up the Custom Objects plugin with Mautic 5.1.1 using the latest compatibility updates, while simplifying the upload process.


Al following steps are done locally in your computer before you even go to mautic instance.

Step 1: Clone the Plugin and Apply Compatibility Changes

  1. Clone the staging branch of the Custom Objects plugin using Git Bash:

git clone -b staging https://github.com/acquia/mc-cs-plugin-custom-objects.git

  1. Go into the cloned folder:

cd mc-cs-plugin-custom-objects

  1. Add the upstream repository:

git remote add upstream https://github.com/acquia/mc-cs-plugin-custom-objects.git

  1. Fetch the changes from PR Update to 5.x #338 (Mautic 5 compatibility):

git fetch upstream pull/338/head:pr-338

  1. Merge the PR into your local staging branch:
git checkout staging
git merge pr-338

Step 2: Prepare the Plugin for Upload

  1. Archive the folder (mc-cs-plugin-custom-objects) into a ZIP file.
  2. Rename the ZIP file to CustomObjectsBundle.zip.

Step 3: Upload and Extract on Mautic Server

  1. Upload CustomObjectsBundle.zip to the plugins folder of your Mautic installation using SFTP or a file manager.
  2. Extract the ZIP file inside the plugins folder.
  3. Rename the extracted folder to CustomObjectsBundle.

Step 4: Install the Plugin in Mautic

  1. SSH into your Mautic server and navigate to the plugins directory
    or in file manager of your server just go to mautic installation directory and go to plugins folder.

cd your-mautic-path/plugins

IMPORTANT STEP: I had error 500, to fix it you need to manually run this command:

  1. Run the Mautic plugin installation command:

sudo /usr/bin/php your-mautic-path/bin/console mautic:plugins:install

o You should see output confirming that 1 plugin was installed.

  1. Clear the Mautic cache:

sudo /usr/bin/php your-mautic-path/bin/console cache:clear


Step 5: Verify Plugin Installation

  1. Log in to your Mautic dashboard.
  2. Go to Settings > Plugins and check if the Custom Objects plugin is listed and activated.

Final Notes
• If you encounter a 500 Internal Server Error after extracting the plugin, this is expected as Mautic needs to recognize the new plugin. It should be resolved after running the installation and clearing the cache.
• If you experience any issues, check the Mautic logs in:

your-mautic-path/var/logs/

After all this you will have CustomObjectsBundle running for Mautic 5 version.

@volha-pivavarchyk
Copy link
Author

@escopecz I fixed the problems after analyzing the cs fixer program. So far, three (cs, twig, phpunit) of the five tasks are working fine locally. Phpstan and rector failed. Do I need to fix all of them? Or is it possible to create a baseline for phpstan for example?

@escopecz
Copy link
Contributor

@volha-pivavarchyk yes, let's generate a baseline file for the PHPSTAN issues.

@volha-pivavarchyk
Copy link
Author

@escopecz Could you please approve CI running

@volha-pivavarchyk
Copy link
Author

@escopecz Could you please approve CI running

One question. For fixing the failed testCustomItemExport test I added a new step to CI. This test works well locally and failed on CI. The reason for the failure is that the media/files/temp/custom_items_export_2024_12_11_23_52_22.csv file could not be created. So I just added the directory.

- name: Create writable directory
      run: mkdir -p ./media/files/temp && chmod -R 755 ./media/files/temp

WDYT?

@driskell
Copy link

driskell commented Jan 8, 2025

@volha-pivavarchyk I opened mautic/mautic#14437 to fix the tabs not appearing on Contacts when loaded via AJAX. The viewName was missing.

Copy link

@kuzmany kuzmany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using this on our branch with couple of our modifications.
It works as expected.
I recommend merge it to 5.x and continue improving it directly.

@volha-pivavarchyk
Copy link
Author

@driskell Thanks! I'll test it this evening

@escopecz escopecz merged commit 62aa707 into acquia:5.x Jan 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.