Column 'change_by' cannot be null

8 years 8 months ago #1 by moose999
Hi there,

Great idea for a component!

Whenever I perform an action that matches a trigger I get the error "Column 'change_by' cannot be null".

Any idea what I can try to fix this?

Many thanks,
Justin

Macrotone Joomla Audit
Version 1.0.2
Joomla! 3.4.3

Please Log in or Create an account to join the conversation.

8 years 8 months ago - 8 years 8 months ago #2 by geoffc
I am not aware of any problems in this area and have had no previous reports, so can I have a little more information please. Is this problem being seen for all trigger types. i.e. INSERT, DELETE and UPDATE or just one? Also is the trigger on a standard Joomla table, or is it on a specific component table. If Joomla can you please tell me the table name name upon which the trigger is placed, or if the later, can you you tell me the table structure so that I may try and replicate the problem and work out a solution.

Regards
Geoff

Please Log in or Create an account to join the conversation.

8 years 8 months ago - 8 years 8 months ago #3 by geoffc
I have inspected the code and I can see what may be a possible cause of the error, but it very dependant upon certain conditions being met which is why I need some details of the table upon which the trigger is placed. The actual code for the trigger generated would also assist in determining the cause.

It is worth noting that the 'change_by' details are derived from the actual SQL statement submitted by the Joomla component, IF they are present otherwise it has to assume it is the Joomla connection user instead, since we cannot determine the Joomla logged in user' from the database itself.

My specified thought is that the table upon which the trigger is placed, has a 'created_by' and/or a 'modified_by' column, but that that they do not refer to the id of the user in the #__users table. Which is used will be dependant upon the trigger type.

Regards
Geoff

Please Log in or Create an account to join the conversation.

8 years 8 months ago #4 by geoffc
I have received the trigger thank you. The #__contents table is very standard and was one that was used for testing so should work. I will try and duplicate the problem.
One possibility was that it was not picking up a valid 'Super User' from the #_users table but that is not the situation here since it should (by using #__contents) be using the modified_by column on the table.
I will update when I have finished my tests.

Regards
Geoff

Please Log in or Create an account to join the conversation.

8 years 8 months ago - 8 years 8 months ago #5 by geoffc
I have managed to duplicate the problem and it was in the area I suspected.

I enclose a zipped file to replace one existing file. Unzip the attached file and replace the following file upon your system:
admin/components/com_jaudit/helpers/jaudit.php.

You then need to remove the existing triggers and recreate them. This time they should work correctly. I have tested the change and it works on my test system now. Not currently sure what changed because it was working correctly before as well, but I suspect I may need to look a bit closer at this specific code and enhance it some more.

Regards
Geoff
Attachments:

Please Log in or Create an account to join the conversation.

8 years 8 months ago #6 by geoffc
In answer to your unasked but implied question re adding the SQL to the forum post, we actively monitor submissions (amongst other things) and have software that tries to detect SQL injection and PHP cross site scripting attempts, and it can be very rigorous in what it interprets as possible violations.

When it detects problems it gives a specific IP address 3 attempts and then bars that IP for a predefined period. Since I am aware of your attempt I have manually lifted the blocking of your IP.

Sorry about that but we have to endeavour to maintain our system. The best way to submit code etc is to attach a file that contains the appropriate code we can then look at.

Regards
Geoff

Please Log in or Create an account to join the conversation.

Time to create page: 0.288 seconds
Go To Top

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries