View Issue Details

IDProjectCategoryView StatusLast Update
0005164phplist applicationInstallationpublic18-02-08 14:06
Status resolvedResolutionfixed 
Product Version2.10.2 
Target Version2.10.7Fixed in Version2.10.4 
Summary0005164: Send page leads to redirect loop - mysql 5 database issue
DescriptionOn my installation, clicking the "send a message" link leads to a redirect loop. I traced this to send_core.php line ~70, where the code reads:

if (!$id) {
  Sql_Query(sprintf('insert into %s (subject,status,entered,sendformat,embargo,repeatuntil,owner,template)
    values("(no subject)","draft",now(),"text and HTML",now(),now(),%d,%d)',$GLOBALS["tables"]["message"],$_SESSION["logindetails"]["id"],$defaulttemplate));
  $id = Sql_Insert_id();

The database schema, however, defines:
"message" => array ( # a message
"fromfield" => array("varchar(255) not null","from"),
"tofield" => array("varchar(255) not null","tofield"),
"replyto" => array("varchar(255) not null","reply-to"),

Thus the above insert statment will fail ("Database error 1364 Field 'fromfield' doesn't have a default value"), because there are 3 not null/no default fields not specified. This leads to a redirection loop.

If you change the schema to specify "DEFAULT ''", it will fix the issue. Rumor has it that if you turn off the (default) strict_trans_table mode in mysql 5, that will work, but most people don't have that level of control over their database servers.

Mysql 5 is no longer beta, sites are beginning to upgrade to it, and strict_trans_table is the default, so I'd expect a lot of people are going to start seeing this soon...

TagsNo tags attached.


related to 0002705 closed PHPList v2.11 release 
related to 0003721 closed phplist 2.10.x 



01-01-06 18:38

reporter   ~0009833

A couple corrections:
1) The option is called strict_trans_tables (I missed the s)
2) The win32 installer definately adds this to my.ini, but the linux version doesn't have it in the default config files. I haven't checked any other systems, so it would be better stated as "the mysql 5 default on some systems"


16-12-06 15:16

manager   ~0022100

On a similar note this was reported by thundr101 in the forum:

"After installing: "Send a message" feature does not load in PHP List. All other features are working, AOK, no problem. But when we click on the "Send a message" link - the page just loops and eventually times out. The link is set correctly, and SMTP is working properly, i.e. customers can subscribe, etc.

In the 'my.ini' file located in c:\Program Files\MySQL\MySQL Server 5.0 - I REMOVED the following line (strict_trans_tables) from the:

# Set the SQL mode to strict

Now all is AOK and send message page works 100%"