Jump to content
thirty bees forum

Tuan Pham

Members
  • Posts

    4
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Tuan Pham

  1. Please disregard my previous question. I found the cause of my issue.

    Here are more details in case they help anyone else. When I edited a file in PayPal module using Emacs, Emacs created a backup file with ~ at the end (e.g., incontextvalidate.php~). I believe TB sees this new file as a new page and adds it to table tb_meta. Later, when I click on Preferences > Themes > Advanced Settings, Panda loads the pages but TB fails on validating incontextvalidate.php~ as a valid file name (due to the ~ character). To fix this, I needed to remove the backup file and remove that corresponding record in table tb_meta.  

  2. I ran into a similar error when clicking on Preferences > Themes > Advanced Settings

    Property Meta->page is not valid
    in file classes/ObjectModel.php at line 1058 

     

    Source file: classes/ObjectModel.php
    
    1039:     * @throws PrestaShopException
    1040:     *
    1041:     * @since   1.0.0
    1042:     * @version 1.0.0 Initial version
    1043:     */
    1044:    public function validateFields($die = true, $errorReturn = false)
    1045:    {
    1046:        foreach ($this->def['fields'] as $field => $data) {
    1047:            if (!empty($data['lang'])) {
    1048:                continue;
    1049:            }
    1050:
    1051:            if (is_array($this->update_fields) && empty($this->update_fields[$field]) && isset($this->def['fields'][$field]['shop']) && $this->def['fields'][$field]['shop']) {
    1052:                continue;
    1053:            }
    1054:
    1055:            $message = $this->validateField($field, $this->$field);
    1056:            if ($message !== true) {
    1057:                if ($die) {
    1058:                    throw new PrestaShopException($message);
    1059:                }
    1060:
    1061:                return $errorReturn ? $message : false;
    1062:            }
    1063:        }
    1064:
    1065:        return true;
    1066:    }
    1067:
    1068:    /**

    Current thirty bees version: 1.1.x

    PANDA theme version: v 1.5.5

    Does anyone have any idea how to fix this?

  3. While I have not fully understood the PayPal module code yet, the following change to the modules/paypal/controllers/front/incontextvalidate.php file fixed the issue for me:

    Line 75, change from  

    $ppc->id_customer = $this->context->customer->id;

    to

    $ppc->id_customer = $customer->id;
    

    My guess is that while the module creates the customer record, the customer has not logged in and thus it is not available in the context.

    I'd appreciate if thirtybees developers can confirm if my change is good or not.

    • Like 2
×
×
  • Create New...