Loading...
 
Skip to main content

User registration bombs with SQL error in 'insert into messu_message...'

Status
Closed
Subject
User registration bombs with SQL error in 'insert into messu_message...'
Version
1.9.x
Category
  • Error
  • Usability
Feature
User Administration (Registration, Login & Banning)
Resolution status
Fixed or Solved
Submitted by
Mike
Volunteered to solve
Mike
Rating
(0)
Description

Not sure if this is prevalent in 1.10.0 or not, but...

User twentytwo had problems in IRC with user registration set to ON with validation set ON. When the regisration form was submitted by the new user, the script would bomb with an SQL error because the first three fields were nulls and couldn't be.

I could only reproduce this bug when User Registration was turned on, with validation also turned on, but with General->Sender email UNSET. So during setup, the sender email was not set. As I also do not have this set at home since I don't want to send any emails, I was able to reproduce the problem. With sender email SET, there is no DB error.

Solution

$contact_user in lib/userslib.php was missing from the global declaration in the send_validation_email function. There are still some problems here with logistics and making sure features and settings are actually set before proceeding, but I managed to fix the major pieces.

When sender email is unset, it triggers a call to messulib->post_message($contact_user, $contact_user, $contact_user, etcetcetc). Initially this bombed because that value was null. What should be happening here, and what does happen once the string is added to globals, is that a Tiki message is sent from the Admin user to the Admin user for that user to pick up in their tiki message box.

This brings up another bug that got fixed. I added a check to ensure that User messaging was turned ON before sending that message. In my case, I also didn't have that set, so the message got sent, got added to the database, but there was no way I could pick it up. Now if User messaging is not enabled, the script will return an error that Registration is not functioning because the server is not configured correctly (I used different wording...).

One thing that is still missing is a .tpl blurb on the website telling the user that a message was sent to the admin user.

There may be some other logistical items that needs checking here.

Importance
8
Priority
40
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
1433
Created
Saturday 01 December, 2007 21:06:18 UTC
by Unknown
LastModif
Saturday 01 December, 2007 21:06:18 UTC


Show PHP error messages