I've been using OC 1.5.6.4 for many years now and have decided it's time to upgrade to 2.3.0.2.
My store is heavily modified to meet my needs, hence why it's taken me so long to upgrade.
In the upgrade process, I'm having to update a number of older extension that have been written by myself and have come stuck with the new extension system and permissions.
Basically I have a postcode lookup extension and have loaded it into extension/postcodelookup/idealpostcode. I also have an extension/extension/postcodelookup which handles the install and what not. This all works fine. I can install the extension, the tables are generated, permissions are set all as it should be.
I'm getting stuck where I try to edit the extension which calls extension/postcodelookup/idealpostcode. At this point I'm getting a permission denied error.
I've checked in user groups and permissions are all set correctly.
If I run $this->user->hasPermission('modify', 'extension/postcodelookup/idealpostcode') it returns true, but for love nor money can I run the extension.
There is nothing in my code that checks the permissions so this is obviously being tested elsewhere but I don't know where this is tested.
Am I missing something?
I hope this all makes sense. Thanks in advance.
My store is heavily modified to meet my needs, hence why it's taken me so long to upgrade.
In the upgrade process, I'm having to update a number of older extension that have been written by myself and have come stuck with the new extension system and permissions.
Basically I have a postcode lookup extension and have loaded it into extension/postcodelookup/idealpostcode. I also have an extension/extension/postcodelookup which handles the install and what not. This all works fine. I can install the extension, the tables are generated, permissions are set all as it should be.
I'm getting stuck where I try to edit the extension which calls extension/postcodelookup/idealpostcode. At this point I'm getting a permission denied error.
I've checked in user groups and permissions are all set correctly.
If I run $this->user->hasPermission('modify', 'extension/postcodelookup/idealpostcode') it returns true, but for love nor money can I run the extension.
There is nothing in my code that checks the permissions so this is obviously being tested elsewhere but I don't know where this is tested.
Am I missing something?
I hope this all makes sense. Thanks in advance.
Can you post controller here?
Last edited by xxvirusxx on Wed Jan 23, 2019 11:10 pm, edited 1 time in total.
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Attach admin controller here for that extension or send me in PM. I can take a look.
Better you use:
And move postcodelookup folder to extension/module
Better you use:
Code: Select all
extension/module/postcodelookup/idealpostcode
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
It's not a module so not a good idea to put it in the module folder.
If I move the extension to it's own folder ie idealpostcode/idealpostcode then it work perfectly.
If I make it fit in to the extensions then it fails with access denied, even though the user group does have access and modify permissions.
Posting my controller code isn't going to solve anything. There is nothing in that code that checks for permissions and it works outside of the extensions folder.
If I move the extension to it's own folder ie idealpostcode/idealpostcode then it work perfectly.
If I make it fit in to the extensions then it fails with access denied, even though the user group does have access and modify permissions.
Posting my controller code isn't going to solve anything. There is nothing in that code that checks for permissions and it works outside of the extensions folder.
Then post in Commercial section or fix yourself
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
If is not module/extension....is just a file?
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Just to clarify.
I know how to write code for opencart. I know how a controller works and how a model works etc. These are fine and do not need to be looked at.
This is a permission issue when the extension is placed inside extension folder. The new extension system is new to me so just want to know if I am missing something which could be causing the problem.
Or where does OC check permissions when you call a controller. If I can find this then I can at least look to see what it's looking for to allow the controller to run without permission errors.
I know how to write code for opencart. I know how a controller works and how a model works etc. These are fine and do not need to be looked at.
This is a permission issue when the extension is placed inside extension folder. The new extension system is new to me so just want to know if I am missing something which could be causing the problem.
Or where does OC check permissions when you call a controller. If I can find this then I can at least look to see what it's looking for to allow the controller to run without permission errors.
I have converted few extensions/module, so I have an idea.
Wait for a PRO and maybe will help you for free without seeing the code.
Wait for a PRO and maybe will help you for free without seeing the code.
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
nobody else on this "community" forum who can offer some sage advise or does everybody just lurk in the commercial section looking to make a quick buck?
If I put my extension into extension/idealpostcode it works
If I put my extension into extension/idealpostcode/idealpostcode it fails with permission errors.
Permissions are set in user groups. That is not the issue.
If I put my extension into extension/idealpostcode it works
If I put my extension into extension/idealpostcode/idealpostcode it fails with permission errors.
Permissions are set in user groups. That is not the issue.
You have this in you Controller extension?
Code: Select all
class ControllerExtensionPostcodelookupIdealposcode extends Controller {
$this->response->redirect($this->url->link('extension/extension', 'token=' . $this->session->data['token'] . '&type=postcodelookup', true));
$data['action'] = $this->url->link('extension/postcodelookup/idealposcode', 'token=' . $this->session->data['token'], true);
if (!$this->user->hasPermission('modify', 'extension/postcodelookup/idealposcode')) {
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
To implement postcode lookup with Ideal Postcodes, perhaps try our OpenCart address validation extension. This was recently released and fully tested with the OpenCart store (OC >3.0.x). We'll be actively testing, maintaining and providing support for this going forward.
We're listed on the OpenCart marketplace: https://www.opencart.com/index.php?rout ... 0postcodes
If you get stuck we also provide support and can patch the extension if required. The extension is continually tested. So if you come across any issues please let us know so we can update them against future regressions.
You can find more information here: https://ideal-postcodes.co.uk/opencart.
Feel free to DM if you need any help.
We're listed on the OpenCart marketplace: https://www.opencart.com/index.php?rout ... 0postcodes
If you get stuck we also provide support and can patch the extension if required. The extension is continually tested. So if you come across any issues please let us know so we can update them against future regressions.
You can find more information here: https://ideal-postcodes.co.uk/opencart.
Feel free to DM if you need any help.
Who is online
Users browsing this forum: No registered users and 174 guests