Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0
haylau

Panda theme or general issues?

Question

@Jonny 

Just upgraded to 1.1 stable from 1.08. And then upgraded Panda to the latest version.

Now, when I go to Preferences > Themes > Advanced Settings (to change columns per page etc) I get the following error. Any ideas?

 

ThirtyBeesException
Property Meta->page length (69) must be between 0 and 64
in file classes/ObjectModel.php at line 1036
Source file: classes/ObjectModel.php
1017:     * @throws PrestaShopException
1018:     *
1019:     * @since   1.0.0
1020:     * @version 1.0.0 Initial version
1021:     */
1022:    public function validateFields($die = true, $errorReturn = false)
1023:    {
1024:        foreach ($this->def['fields'] as $field => $data) {
1025:            if (!empty($data['lang'])) {
1026:                continue;
1027:            }
1028:
1029:            if (is_array($this->update_fields) && empty($this->update_fields[$field]) && isset($this->def['fields'][$field]['shop']) && $this->def['fields'][$field]['shop']) {
1030:                continue;
1031:            }
1032:
1033:            $message = $this->validateField($field, $this->$field);
1034:            if ($message !== true) {
1035:                if ($die) {
1036:                    throw new PrestaShopException($message);
1037:                }
1038:
1039:                return $errorReturn ? $message : false;
1040:            }
1041:        }
1042:
1043:        return true;
1044:    }
1045:
1046:    /**
Stack trace
1. classes/ObjectModel.php:324 source ObjectModelCore->validateFields()
2. classes/ObjectModel.php:586 source ObjectModelCore->getFields()
3. controllers/admin/AdminThemesController.php:269 source ObjectModelCore->add()
4. classes/controller/AdminController.php:2461 source AdminThemesControllerCore->renderForm()
5. controllers/admin/AdminThemesController.php:1753 source AdminControllerCore->initContent()
6. classes/controller/Controller.php:208 source AdminThemesControllerCore->initContent()
7. classes/Dispatcher.php:837 source ControllerCore->run()
8. nimda/index.php:63 source DispatcherCore->dispatch()

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

The problem is that there is some module with long controller name. Controller name is used to compose page key in form:

module-<module_name>-<controller_name>

for example

module-paypal-plussubmit

Thirtybees has limit 64 characters for these meta page entries. If (( module name lenth + controller name length + 8 ) > 64) then this error is thrown, because the resulting page key can't fit database column.

This limit is obviously too small, we should increase it for the next version of tb. I've created github issue to increase this limit.

Meanwhile, you can do this to fix the situation:

Edit file classes/Meta.php and change size of the page property to 128:

 'page'         => ['type' => self::TYPE_STRING, 'validate' => 'isFileName', 'required' => true, 'size' => 64],

to

 'page'         => ['type' => self::TYPE_STRING, 'validate' => 'isFileName', 'required' => true, 'size' => 128],

You will also have to connect to your phpadmin and modify table schema (you might need to change table name tb_meta according to your database prefix):

ALTER TABLE `tb_meta` MODIFY `page` varchar(128) NOT NULL;

 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...