Skip to content
Advertisement

PHP changes not showing up until Composer Update

I’m working on a cronjob that will delete products by last date updated.

I’m seeing very strange Magento 2 behavior – the PHP file changes are not showing up until I update the repository and then run composer update.

The store is in Development mode. Running via Docker-compose.

During development on other plugins as soon as I do:

JavaScript

The file changes show up and sometimes even without these commands.

But, with this plugin the changes do not show up until I fully push changes to repository and then run composer update with all the other commands.

Is there some kind of caching for cron job classes that I don’t know about?

FOLDER STRUCTURE

Here is my folder structure:

JavaScript

The DeleteOldProducts.php is being used by the cron job, but uses an old version of it. I try to make changes to it, re-run the commands mentioned above, but cronjob still uses old version of the file. This is not normal.

Here is the php file:

JavaScript

Why is this happening?

Advertisement

Answer

I found the issue – I had naming conflicts between the the plugin I was developing and the one in the composer

One was “deleteoldproducts” and the one in composer was “module-deleteoldproducts”.

Should have deleted the original folder after I pushed it to repository.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement