Jump to content

Installation of module failed. Property Employee->email is empty.


Recommended Posts

Hi Everyone,

After upgrading to 8.01 from 1.7.8.8 we're getting the following error when trying to upload a module:

Installation of module prettyurls failed. Property Employee->email is empty.

We're sure this is something silly to check after upgrade.  Any ideas?  We notice that it says connected on the modules page but there is no option to log out.. we assume this is the connection to prestashop addons?  We're confused.  Let us know.  

Link to comment
Share on other sites

When turning on debug, we immediately see this stack trace:

 

PrestaShop\PrestaShop\Core\Exception\CoreException

in classes/Hook.php (line 420)

                }

            }

        } catch (Exception $e) {

            $environment = ServiceLocator::get('\\PrestaShop\\PrestaShop\\Adapter\\Environment');

            if ($environment->isDebug()) {

                throw new CoreException($e->getMessage(), $e->getCode(), $e);

            }

        }

        return '';

    }

 

HookCore::callHookOn(object(ps_mbo), 'actionDispatcherBefore', array('_ps_version' => '8.0.1', 'request' => object(Request), 'route' => 'admin_performance', 'controller_type' => 2, 'cookie' => object(Cookie), 'cart' => null, 'altern' => 1))in classes/Hook.php (line 903)

HookCore::exec('actionDispatcherBefore', array('_ps_version' => '8.0.1', 'request' => object(Request), 'route' => 'admin_performance', 'controller_type' => 2, 'cookie' => object(Cookie), 'cart' => null, 'altern' => 1), 57, false)in src/Adapter/LegacyHookSubscriber.php (line 127)

LegacyHookSubscriber->__call('call_135_57', array(object(HookEvent), 'actionDispatcherBefore', null))in src/Adapter/Hook/HookDispatcher.php (line 135)

HookDispatcher->doDispatch(array(array(object(LegacyHookSubscriber), 'call_135_57')), 'actionDispatcherBefore', object(HookEvent))in src/Adapter/Hook/HookDispatcher.php (line 88)

HookDispatcher->dispatch('actionDispatcherBefore', object(HookEvent))in src/Adapter/Hook/HookDispatcher.php (line 165)

HookDispatcher->dispatchForParameters('actionDispatcherBefore', array('controller_type' => 2))in src/Core/Hook/HookDispatcher.php (line 58)

HookDispatcher->dispatchHook(object(Hook))in src/Core/Hook/HookDispatcher.php (line 67)

HookDispatcher->dispatchWithParameters('actionDispatcherBefore', array('controller_type' => 2))in src/PrestaShopBundle/EventListener/ActionDispatcherLegacyHooksSubscriber.php (line 89)

in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php -> callActionDispatcherBeforeHook (line 126)

in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php -> __invoke (line 264)

in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php -> doDispatch (line 239)

in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php -> callListeners (line 73)

in vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php -> dispatch (line 168)

in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php -> dispatch (line 157)

in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php -> handleRaw (line 81)

in vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php -> handle (line 201)

Kernel->handle(object(Request), 1, false)in psadmin/index.php (line 81)

PrestaShopException

Property Employee->email is empty.

 

Link to comment
Share on other sites

  • 4 weeks later...

the same issue for me.

On 2/22/2023 at 8:57 AM, JBW said:

Try to reset/re-install module ps_mbo

reset of ps_mbo helps, thank you JBW !

and for those who would stuck in the debag mode: manually change "true"  to "false" in line 29 in file //config/defines.inc.php

define('_PS_MODE_DEV_', false);

 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 2 months later...

I had this also with prestashop 8.0.1
in the file classes/ObjectModel.php
on line 1070 you find the function which validates this

I changed it a bit so when email is empty it will be filled with the addons (or any) email adress
see the 4 lines between
$message = $this->validateField($field, $this->$field); and if ($message !== true) {
 
    public function validateFields($die = true, $error_return = false)
    {
        foreach ($this->def['fields'] as $field => $data) {
            if (!empty($data['lang'])) {
                continue;
            }

            if (is_array($this->update_fields) && empty($this->update_fields[$field]) && isset($this->def['fields'][$field]['shop']) && $this->def['fields'][$field]['shop']) {
                continue;
            }
            
            $message = $this->validateField($field, $this->$field);
            
if ($field=='email' && empty($this->$field)) {
  $this->$field='[email protected]';
  $message=true;
}
            if ($message !== true) {
                if ($die) {
                    throw new PrestaShopException($message);
                }

               return $error_return ? $message : false;
            }
        }

        return true;
    }

Link to comment
Share on other sites

  • 3 months later...

Hi @Henry Vermeulen

Thanks for your suggested fix. I implemented it in the same fashion and it seemed to solve the problem.

However i have recently noticed that this fix seems to have a strange affect on the Prestashop database. In that it is triggers the creation of multiple entries into the ps_employee table using the email set in the fix e.g. [email protected]. Each entry has the first name "Prestashop" and the last name "Marketplace"

Are you getting the same behaviour in your database?

- Rich

 

 

 

Edited by hygap (see edit history)
Link to comment
Share on other sites

  • 1 month later...

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...