Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.
Navigation

Field 'user_sig' doesn't have a default value when clicked activation email new reg

Last updated on 6 years ago
CraigCraig
Posted 6 years ago
Please READ Carefully so as you understand. I will not repeat myself unnecessarily :G

Version: 7.02.07
Registration State: Email Activation & Admin Activation

After the user clicks to activate his new registered account it will produce this error at us...

Quote

Field 'user_sig' doesn't have a default value


User Sig Field does not need a default value so why is it throwing that error after registering and clicking the activation link in the email?

This seems to be happening with user fields which use TEXT NOT NULL

Thanks
Edited by Craig on 24-08-2014 14:54, 6 years ago
HomdaxHomdax
Posted 6 years ago
I verify this behavior, new registration do get to the new_user table, but after activating them, via link (admin activation) they never get in to the user table.

We have tried several registrations and narrowed it down to the fact Craig mentions above.
PHP version 5.4.27 Mysql version 5.6.12
When user_field, as posted by Craig above, is disabled, it works.
Edited by Homdax on 24-08-2014 15:03, 6 years ago
CraigCraig
Posted 6 years ago
Also can I verify this happens with googlemail.com gmail.com and @mysite.co.uk and @richardainzsite.com dunno if relivent which email services but just saying in case.


EDIT::
TEXT NOT NULL DEFAULT '' is probably what it needs rather than just TEXT NOT NULL lol? Yes?
Edited by Craig on 24-08-2014 15:03, 6 years ago
JoiNNNJoiNNN
Posted 6 years ago
Now https://www.php-fusion.co.uk/infusions/roadmap/submit.php
CraigCraig
Posted 6 years ago
Yeah wait until confirmed, but we changed to TEXT NOT NULL DEFAULT '' and it made no difference still the error exists. So unless I think quick then we are in need of a fix.

Any idea?
JoiNNNJoiNNN
Posted 6 years ago
Can't test it, but TEXT can't have a DEFAULT value, meanwhile try VARCHAR(500) NOT NULL DEFAULT '' instead of TEXT NOT NULL. Remember for the column type to take effect you need to re-enable the userfield or manually change it.

Also TEXT NOT NULL is actually correct.
Edited by JoiNNN on 24-08-2014 19:00, 6 years ago
CraigCraig
Posted 6 years ago
Dunno why Sig user field is TEXT anyway it is better being VARCHAR 500 or something like you say.
ChanChan
Posted 6 years ago
Difference in memory? Not sure...either. But either way works right? Unless we are putting a cap on word limit then varchar is way to go.. But should we?
FalkFalk
Posted 6 years ago
Yeah, we rarely see more than 500 chars in a signature.
I would not want to see that here either.
I will implement the changes so we also address the problem there, thank you.
CraigCraig
Posted 6 years ago
Yep, thanks Hien and Domi but see that error that I post about is it true? Would that affect registration?
HomdaxHomdax
Posted 6 years ago
I do not understand why those fields are called upon when triggering activation link in the first place. They are not mandatory, register.php is default, no code changes.
FalkFalk
Posted 6 years ago
We can set some labs on it for verification and fix test.
The fields are touched since they are serialized in new_users and get´s unserialized and injected to users upon activation.
CraigCraig
Posted 6 years ago
Yep, can you test out using googlemail.com gmail.com also and admin and email activation please? This seems to be our conditions. Whether the email service is the issue or not since I think it does not matter about what email service you use can't be the issue unless php mailer sendemail has something annoying gmail?

Merged on Aug 25 2014 at 12:59:12:
Right!

Look at this user field of mine it's called user_intro....

See, I know how to code a little user field I mean I am not completely dumb that I can not code a simple user field according to the user field core api 1.01.00. I have been coding user fields for 7.02 since 7.02 was release years ago so how would all a sudden this error occur for this one user field which follows the exact same api methods as all the rest of them but this is the only user filed that produces this error. How gremlin is that? It is not possible!

So the user field core api 1.01.00. is bugged or?

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_intro_include.php
| Author: Digitanium, Craig
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

// Display user field input
if ($profile_method == "input") {
      add_to_head("<script language='javascript' type='text/javascript' src='".INCLUDES."user_fields/ckeditor/ckeditor.js'></script>\n
   <script src='".INCLUDES."user_fields/ckeditor/adapters/jquery.js'></script>
   <script type='text/javascript'>
   $( document ).ready( function() {
   $( '#user_intro' ).ckeditor();
} );</script>");

   $user_intro = isset($user_data['user_intro']) ? $user_data['user_intro'] : "";
   if ($this->isError()) { $user_intro = isset($_POST['user_intro']) ? addslash($_POST['user_intro']) : $user_intro; }

   echo "<tr>\n";
   echo "<td valign='top' class='tbl".$this->getErrorClass("user_intro")."'><label for='user_intro'>".$locale['uf_intro'].$required."</label></td>\n";
   echo "<td class='tbl".$this->getErrorClass("user_intro")."'>";
   echo "<textarea id='user_intro' name='user_intro' cols='120' rows='5' class='textbox' style='width:495px'>".$user_intro."</textarea><br />\n";
   echo "</td>\n</tr>\n";

   if ($required) { $this->setRequiredJavaScript("user_intro", $locale['uf_intro_error']); }

// Display in profile
} elseif ($profile_method == "display" && $user_data['user_intro'] !=="") {
      echo "</table>";
      echo "<div style='height:5px; font-size:0;'></div>";
      echo "<table class='profile tbl-border center' cellspacing='1'>";
      echo "<tr>\n";
      echo "<td  colspan='2' class='tbl2' ><strong>".$locale['uf_intro']."</strong></td>\n";
      echo "</tr><tr>";
      echo "<td colspan='2' class='tbl1'>".stripslashes($user_data['user_intro'])."</td>\n";
      echo "</tr><tr>\n";
      echo "<td  colspan='2' class='tbl2' >&nbsp;</td></tr>\n";
// Insert and update
} elseif ($profile_method == "validate_insert"  || $profile_method == "validate_update") {
   // Get input data
   if (isset($_POST['user_intro']) && ($_POST['user_intro'] != "" || $this->_isNotRequired("user_intro"))) {
      // Set update or insert user data
      $this->_setDBValue("user_intro", addslash(trim($_POST['user_intro'])));
   } else {
      $this->_setError("user_intro", $locale['uf_intro_error'], true);   
   }
}
?>



<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_sig_include_var.php
| Author: Digitanium, Craig
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

// Version of the user fields api
$user_field_api_version = "1.01.00";

$user_field_name = $locale['uf_intro'];
$user_field_desc = $locale['uf_intro_desc'];
$user_field_dbname = "user_intro";
$user_field_group = 3;
$user_field_dbinfo = "TEXT NOT NULL DEFAULT''";
?>
Edited by Craig on 25-08-2014 12:05, 6 years ago
ChanChan
Posted 6 years ago
Usually sig was used as like this... img src='http://something.com/images/folder/next_folder/my_name/..... 500 words.... therefore I think for this reason given a text value.

Well, just change to VARCHAR 200 DEFAULT '' NOT NULL should be fine.
CraigCraig
Posted 6 years ago
No if you read up you will see I have tested varchar text text not null and all that jazzz man but it's not the issue mate.

Maybe I did not post i tested that but anyway I we did test that theory it makes no difference to the error and conditions of it.


TEXT NOT NULL No difference Error exists
VARCHAR 200 DEFAULT '' NOT NULL No difference Error Exists
TEXT NOT NULL DEFAULT'' No Difference Error Exists
ChanChan
Posted 6 years ago

Quote

Yep, can you test out using googlemail.com gmail.com also and admin and email activation please? This seems to be our conditions. Whether the email service is the issue or not since I think it does not matter about what email service you use can't be the issue unless php mailer sendemail has something annoying gmail?

Merged on Aug 25 2014 at 12:59:12:
Right!

Look at this user field of mine it's called user_intro....

See, I know how to code a little user field I mean I am not completely dumb that I can not code a simple user field according to the user field core api 1.01.00. I have been coding user fields for 7.02 since 7.02 was release years ago so how would all a sudden this error occur for this one user field which follows the exact same api methods as all the rest of them but this is the only user filed that produces this error. How gremlin is that? It is not possible!

So the user field core api 1.01.00. is bugged or?

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_intro_include.php
| Author: Digitanium, Craig
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

// Display user field input
if ($profile_method == "input") {
      add_to_head("<script language='javascript' type='text/javascript' src='".INCLUDES."user_fields/ckeditor/ckeditor.js'></script>\n
   <script src='".INCLUDES."user_fields/ckeditor/adapters/jquery.js'></script>
   <script type='text/javascript'>
   $( document ).ready( function() {
   $( '#user_intro' ).ckeditor();
} );</script>");

   $user_intro = isset($user_data['user_intro']) ? $user_data['user_intro'] : "";
   if ($this->isError()) { $user_intro = isset($_POST['user_intro']) ? addslash($_POST['user_intro']) : $user_intro; }

   echo "<tr>\n";
   echo "<td valign='top' class='tbl".$this->getErrorClass("user_intro")."'><label for='user_intro'>".$locale['uf_intro'].$required."</label></td>\n";
   echo "<td class='tbl".$this->getErrorClass("user_intro")."'>";
   echo "<textarea id='user_intro' name='user_intro' cols='120' rows='5' class='textbox' style='width:495px'>".$user_intro."</textarea><br />\n";
   echo "</td>\n</tr>\n";

   if ($required) { $this->setRequiredJavaScript("user_intro", $locale['uf_intro_error']); }

// Display in profile
} elseif ($profile_method == "display" && $user_data['user_intro'] !=="") {
      echo "</table>";
      echo "<div style='height:5px; font-size:0;'></div>";
      echo "<table class='profile tbl-border center' cellspacing='1'>";
      echo "<tr>\n";
      echo "<td  colspan='2' class='tbl2' ><strong>".$locale['uf_intro']."</strong></td>\n";
      echo "</tr><tr>";
      echo "<td colspan='2' class='tbl1'>".stripslashes($user_data['user_intro'])."</td>\n";
      echo "</tr><tr>\n";
      echo "<td  colspan='2' class='tbl2' >&nbsp;</td></tr>\n";
// Insert and update
} elseif ($profile_method == "validate_insert"  || $profile_method == "validate_update") {
   // Get input data
   if (isset($_POST['user_intro']) && ($_POST['user_intro'] != "" || $this->_isNotRequired("user_intro"))) {
      // Set update or insert user data
      $this->_setDBValue("user_intro", addslash(trim($_POST['user_intro'])));
   } else {
      $this->_setError("user_intro", $locale['uf_intro_error'], true);   
   }
}
?>



<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_sig_include_var.php
| Author: Digitanium, Craig
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

// Version of the user fields api
$user_field_api_version = "1.01.00";

$user_field_name = $locale['uf_intro'];
$user_field_desc = $locale['uf_intro_desc'];
$user_field_dbname = "user_intro";
$user_field_group = 3;
$user_field_dbinfo = "TEXT NOT NULL DEFAULT''";
?>

- by Craig


Looks alright to me, at least I think. Let me know if you manage to solve it.
CraigCraig
Posted 6 years ago
Thanks, cheers aye! :|
HomdaxHomdax
Posted 6 years ago
Does not work.
I will do some more testing, but if we cant find a solution to this within few days I will have to dump the current solution. And PHPFusion for it.
ChanChan
Posted 6 years ago
Craig, with PHP-Storm, you can pair up with xDebug, and run a backtrace to see what goes wrong where.
CraigCraig
Posted 6 years ago
Aye, I use notepad++ :G
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
You cannot set up a bounty in this discussion thread.
Moderator: Support Team
Users who participated in discussion: Falk, Homdax, Craig, Chan, JoiNNN,