Report any technical problems you discover and discuss solutions.

V3 beta: DB folder field not set correctly - fixed

  • jayaich
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
11 years 1 week ago - 11 years 1 week ago #2945 by jayaich
Hi,

I noticed that the 'folderdetails' table 'date_created' field showed that the folders created for me
were created on 2008-12-08 ! This was obviously wrong. It seems that the date_created field is not initialised
to the current date in the 'user_library.php' file (functions 'recycle_bin' and 'create_a_virtual_root_folder').

A patch for this:
============================
Code:
--- user_library.php.orig 2015-07-23 22:17:27.000000000 +0100 +++ user_library.php 2015-07-29 22:32:40.160501332 +0100 @@ -136,8 +136,8 @@ if(sizeof($res)==0){ $query = "insert into {$xerte_toolkits_site->database_table_prefix}folderdetails - (login_id,folder_parent,folder_name) VALUES (?,?,?)"; - $res = db_query($query, array($_SESSION['toolkits_logon_id'], "0", "recyclebin") ); + (login_id,folder_parent,folder_name,date_created) VALUES (?,?,?,?)"; + $res = db_query($query, array($_SESSION['toolkits_logon_id'], "0", "recyclebin", date('Y-m-d')) ); if($res) { @@ -192,10 +192,10 @@ $prefix = $xerte_toolkits_site->database_table_prefix ; - $query = "insert into {$prefix}folderdetails (login_id,folder_parent,folder_name) VALUES (?,?,?)"; - $params = array($_SESSION['toolkits_logon_id'], "0", $_SESSION['toolkits_logon_username']); + $query = "insert into {$prefix}folderdetails (login_id,folder_parent,folder_name,date_created) VALUES (?,?,?,?)"; + $params = array($_SESSION['toolkits_logon_id'], "0", $_SESSION['toolkits_logon_username'], date('Y-m-d')); - if(db_query($query, $params)){ + if(db_query($query, $params) !== false){ receive_message($_SESSION['toolkits_logon_username'], "ADMIN", "SUCCESS", "Succeeded in creating users root folder " .$_SESSION['toolkits_logon_id'], "Succeeded in creating users root folder " .$_SESSION['toolkits_logon_id']);
============================
Last edit: 11 years 1 week ago by jayaich.
The following user(s) said Thank You: JohnSmith

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

More
11 years 1 week ago #2946 by JohnSmith
Thanks John, will get that committed once the Github updates to reflect that v3 is out of beta...

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

  • jayaich
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
9 years 5 months ago #4238 by jayaich
In Xerte 3.3 it looks like this correction has not been applied.


John.

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

More
9 years 5 months ago #4243 by JohnSmith
Not sure why that was never done or if it was reverted but i'll raise it as an issue on Github.

John

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

Moderators: ronmjultenJohnSmith
Time to create page: 0.174 seconds
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo