Land Of Coder module registration issue fix

Registering a module when the vendor's code is broken

- Chris Pook, 02nd October 2019

The problem

Recently a client of ours asked us to install a third party Mega Menu module by LandOfCoder on their site. In doing so we encountered an issue with the vendor's custom registration code which meant the module cannot be registered. Despite entering a valid code and saving the config we were still met with an "invalid" status message.

Land of coder mega menu module status invalid

The solution

The vendor requested FTP access (as is usually the way nowadays with Magento vendors). Instead of giving access and waiting for a resolution, we ran through the code and discovered that the hook for saving the licence key in the standard Magento core config data was not triggering due to it hooking in to a non-existant event. This meant that subsequent checks of the licence against the LandOfCoder remote licence server were failing as there was no licence saved in the config to check.

To get the module to register we realised all that is needed is to add the relevant entry in the core_config_data table, the rest is then picked up by the working remote check element of the module.

The MySql insert to do so is as follows:

INSERT INTO `core_config_data`
    (`scope`, `scope_id`, `path`, `value`)
VALUES
    ('default', '0', 'veslicense/general/vesmegamneupro', 'aaaaa-bbbbb-ccccc-ddddd-eeeee'),
    ('default', '0', 'loflicense/general/vesmegamneupro', 'aaaaa-bbbbb-ccccc-ddddd-eeeee');

Note there are two entries, one for loflicense and one for veslicense. This same process would be applicable for other LandOfCoder modules, you'd just need to update the module name in the path. The required string can be found by inspecting the config input in the Magento admin panel looking for the relevant name="groups[general][fields][vesmegamneupro][value] entry.

The result

After updating the config as above a quick flush of the config cache and reload of the admin page gave us this:

Land of coder mega menu module status valid

Hopefully this post might help you out if you're encountering the same issue.

location icon

Visit us

Central London, UK