Author Topic: Error while loading inital data for plugin 'mail'.  (Read 5243 times)

Tom11

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
Error while loading inital data for plugin 'mail'.
« on: October 30, 2012, 09:06:30 AM »
Hi

At the beginning sorry for my English.

I have a small problem ... Feng Office installation appeared to me an error that I can not solve.

I received a message:

"Error while loading inital data for plugin 'mail'. Subquery returns more than 1 row"

What do I do to fix it?

Thank you very much

davinci440

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Error while loading inital data for plugin 'mail'.
« Reply #1 on: November 10, 2012, 12:17:27 PM »
I am having the same problem with feng office 2.2.1. will try with feng office 2.2.0

designbuyers

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Error while loading inital data for plugin 'mail'.
« Reply #2 on: December 02, 2012, 11:00:22 AM »
I have same issue with the installation.

Not sure what to do, but seems it will be using the php mail,

Not yet sure..

fengoffice@thingsdone.eu

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Error while loading inital data for plugin 'mail'.
« Reply #3 on: December 23, 2012, 08:28:26 PM »
Another one :

Exactly the same issue, while installing (not upgrading) a fresh new install.

No mail working, since then.

Upgrading was way too buggy, so we tried to restart from scratch. But not much better. Should we give up definitely ?

apmuthu

  • Freshman
  • *
  • Posts: 28
    • View Profile
Re: Error while loading inital data for plugin 'mail'.
« Reply #4 on: December 25, 2012, 08:54:49 PM »
"Error while loading inital data for plugin 'mail'. Subquery returns more than 1 row"

The string Error while loading inital data for plugin is found in:

  • public/install/installation/plugin_acInstallation.class.php (Line 710)
  • public/install/installation/acInstallation.class.php (Line 670)

One is used during the install of plugins at initial setup time and the other thereafter.
Both have the function installPlugins() defined in them at line 556.
Lines are 596-624 in the former and 580-607 in the latter are where plugin define types are first inserted.


The location of the SQL statement that raises the error is at
   plugins/mail/install/sql/mysql_initial_data.php
referred to in lines 702 and 663 respectively.

SELECT * FROM fo_object_types WHERE `name`='mail'; // plugin_id=4 yields 2 rows:

id   name   handler_class   table_name   type   icon   plugin_id
21   mail   MailContents   mail_contents   content_object   mail   4
22   mail   MailContents   mail_contents   content_object   mail   4

fo_plugins table does not have id=2.
fo_object_types does not have id=7.
fo_object_types id from 1 to 18 have plugin_id=NULL.

The error arises during the execution of the first SQL statement in :
install/sql/mysql_initial_data.php

The record was already inserted when plugin define types are installed.
The mail plugin define types are taken from lines 10-20 in:
plugins/mail/info.php


Recommendation:
hxxp://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
In general, you should try to avoid using an ON DUPLICATE KEY UPDATE clause on tables with multiple unique indexes.
The table fo_object_types has multiple indexes and the non-primary keys are not declared unique - not even in combination.

The solution:
Since any mail plugin install inserts the define types taken from plugins/mail/info.php, the first SQL statement can be deleted in
plugins/mail/install/sql/mysql_initial_data.php


apmuthu

  • Freshman
  • *
  • Posts: 28
    • View Profile
Re: Error while loading inital data for plugin 'mail'.
« Reply #5 on: December 25, 2012, 09:26:09 PM »
An additional or exclusive solution can be:

Better still, fix the original schema for the base install as well:
ALTER TABLE `fengoffice`.`fo_object_types` ADD INDEX `nameclass` (`name`, `handler_class`, `table_name`);

This code in the base schema should be in:
public/install/installation/templates/sql/mysql_schema.php
by inserting at line 145:
  KEY `nameclass` (`name`,`handler_class`,`table_name`),