Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
Report any technical problems you discover and discuss solutions.
  • Page:
  • 1

TOPIC:

V3 beta: DB folder field not set correctly - fixed 9 years 3 months ago #2945

  • jayaich
  • jayaich's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 82
  • Thank you received: 5
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:
============================
--- 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']);
 
============================
The following user(s) said Thank You: JohnSmith

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

Last edit: by jayaich.

V3 beta: DB folder field not set correctly - fixed 9 years 3 months ago #2946

  • JohnSmith
  • JohnSmith's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 397
  • Thank you received: 71
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.

V3 beta: DB folder field not set correctly - fixed 7 years 9 months ago #4238

  • jayaich
  • jayaich's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 82
  • Thank you received: 5
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.

V3 beta: DB folder field not set correctly - fixed 7 years 9 months ago #4243

  • JohnSmith
  • JohnSmith's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 397
  • Thank you received: 71
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.

  • Page:
  • 1
Moderators: ronmjultenJohnSmith
Time to create page: 0.047 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search