phplist

NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1


View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005164phplist applicationInstallationpublic01-01-06 18:1318-02-08 14:06
Reporterrzg 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
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();
  Redirect($_GET["page"]."&id=$id");
  exit;

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

Refs:
http://wordpress.org/support/topic/52753, [^] http://dev.mysql.com/doc/refman/5.0/en/constraint-invalid-data.html [^]
TagsNo tags attached.
Attached Files

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

-  Notes
(0009833)
rzg (reporter)
01-01-06 18:38

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"
(0022100)
h2b2 (manager)
16-12-06 15:16

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
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

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

Ref: http://forums.phplist.com/viewtopic.php?p=25802#25802 [^]


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker