Post by ecoleman » Wed Jan 23, 2019 10:12 pm

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.

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by xxvirusxx » Wed Jan 23, 2019 10:57 pm

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


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by ecoleman » Wed Jan 23, 2019 11:05 pm

Sorry, I have no idea what you are asking

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by xxvirusxx » Wed Jan 23, 2019 11:10 pm

Attach admin controller here for that extension or send me in PM. I can take a look.

Better you use:

Code: Select all

extension/module/postcodelookup/idealpostcode
And move postcodelookup folder to extension/module

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by ecoleman » Wed Jan 23, 2019 11:16 pm

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.

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by xxvirusxx » Wed Jan 23, 2019 11:24 pm

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


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by ecoleman » Wed Jan 23, 2019 11:25 pm

Why would I post in the commercial section? I'm asking for a bit of help, but you don't even understand the issue I'm having because if you did you wouldn't be asking me to post up code.

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by xxvirusxx » Wed Jan 23, 2019 11:31 pm

ecoleman wrote:
Wed Jan 23, 2019 10:12 pm
I'm getting stuck where I try to edit the extension.
ecoleman wrote:
Wed Jan 23, 2019 11:16 pm
It's not a module
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


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by ecoleman » Wed Jan 23, 2019 11:34 pm

If you can't help, please move on. You clearly have no idea what you are talking about.

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by ecoleman » Wed Jan 23, 2019 11:47 pm

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.

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by xxvirusxx » Wed Jan 23, 2019 11:50 pm

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.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by ecoleman » Thu Jan 24, 2019 12:21 am

It's NOT a module. A module is something that can be added to the layout of a page(s)

An extension is an extension, such as shipping, payments, captcha, totals etc.

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by ecoleman » Thu Jan 24, 2019 5:09 pm

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.

Active Member

Posts

Joined
Tue Dec 06, 2011 3:34 am

Post by xxvirusxx » Thu Jan 24, 2019 6:08 pm

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


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by idealpostcodes » Thu Sep 03, 2020 10:30 pm

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.


Posts

Joined
Wed Aug 26, 2020 11:26 pm
Who is online

Users browsing this forum: No registered users and 174 guests