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

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

by Craig, Last updated on 5 years ago in User Administration - 8
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
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.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» Name and Organize your content correctly for best results - use good grammar

Who the hell thought "erectus" was a good species name for our ancestors?
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?
Now https://www.php-fusion.co.uk/infusions/roadmap/submit.php
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?
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.
Dunno why Sig user field is TEXT anyway it is better being VARCHAR 500 or something like you say.
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?
Lead Developer of PHP-Fusion
Developer Tweet: https://twitter.com/phpfusion_tweet
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.
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Please read and comply with the Code of Conduct

(¯`·._.·(¯`°·._.·°º*[ Project Manager ]*º°·._.·°´¯)·._.·´¯)
Yep, thanks Hien and Domi but see that error that I post about is it true? Would that affect registration?
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.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» Name and Organize your content correctly for best results - use good grammar

Who the hell thought "erectus" was a good species name for our ancestors?
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.
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Please read and comply with the Code of Conduct

(¯`·._.·(¯`°·._.·°º*[ Project Manager ]*º°·._.·°´¯)·._.·´¯)
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
/*-------------------------------------------------------+
| PHP-Fusion 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
/*-------------------------------------------------------+
| PHP-Fusion 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''";
?>
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.
Lead Developer of PHP-Fusion
Developer Tweet: https://twitter.com/phpfusion_tweet
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

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
/*-------------------------------------------------------+
| PHP-Fusion 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
/*-------------------------------------------------------+
| PHP-Fusion 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.
Lead Developer of PHP-Fusion
Developer Tweet: https://twitter.com/phpfusion_tweet
Thanks, cheers aye! :|
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 PHP-Fusion for it.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» Name and Organize your content correctly for best results - use good grammar

Who the hell thought "erectus" was a good species name for our ancestors?
Craig, with PHP-Storm, you can pair up with xDebug, and run a backtrace to see what goes wrong where.
Lead Developer of PHP-Fusion
Developer Tweet: https://twitter.com/phpfusion_tweet
Aye, I use notepad++ :G
You can view all discussion threads in this forum.
You can 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.
Users who participated in discussion: Falk, Homdax, Craig, Chan, JoiNNN