- This topic has 17 replies, 3 voices, and was last updated 6 years, 3 months ago by
Steve.
-
AuthorPosts
-
-
October 13, 2015 at 11:40 am #4552
justinMemberI have a Group field that is set as add_more => true and after I ran the script successfully, the data in the database is not formatted the same. It seems like it is pulling correctly inside of the user profile, and if I update the profile, then the mysql data is updated to the new corrected format. The problem I am having is displaying the content with 2 different formats and it broke my front-end template that displays the data.
Data saved before migration:
Array ( [0] => Array ( [user_job] => Array ( [0] => 3464 [1] => 3698 ) [user_job_start] => Array ( [0] => 2010-02-05 [1] => 2012-04-29 ) [user_job_current] => Array ( [0] => Array ( [0] => job_old ) [1] => Array ( [0] => job_current ) ) [user_job_end] => Array ( [0] => 2012-04-28 [1] => ) ) )Data saved after migration:
Array ( [0] => Array ( [0] => Array ( [user_job] => 3695 [user_job_start] => 2014-09-11 [user_job_current] => Array ( [0] => job_current ) [user_job_end] => ) [1] => Array ( [user_job] => 3582 [user_job_start] => 2015-06-09 [user_job_current] => Array ( [0] => job_old ) [user_job_end] => 2015-10-07 ) ) )Here is my group
piklist('field', array( 'type' => 'group' ,'field' => 'user_jobs_group' ,'add_more' => true ,'label' => __('Jobs') ,'columns' => 12 ,'description' => 'Add each job and history.' ,'fields' => array( array( 'type' => 'select' ,'field' => 'user_job' ,'label' => 'Job' ,'columns' => 4 ,'choices' => piklist( get_posts( array( 'post_type' => 'post_jobs' ,'orderby' => 'title' ,'order' => 'asc' ,'posts_per_page' => -1 ,'post_status'=> 'any' ) ,'objects' ) ,array( 'ID' ,'post_title' ) ) ) ,array( 'type' => 'datepicker' ,'field' => 'user_job_start' ,'label' => 'Start' ,'columns' => 3 ,'options' => array( 'dateFormat' => 'yy-mm-dd' ,'firstDay' => '0' ) ) ,array( 'type' => 'radio' ,'field' => 'user_job_current' ,'label' => 'Current?' ,'columns' => 2 ,'choices' => array( 'job_current' => 'Current' ,'job_old' => 'Past' ) ) ,array( 'type' => 'datepicker' ,'field' => 'user_job_end' ,'label' => 'End' ,'columns' => 3 ,'conditions' => array( array( 'field' => 'user_job_current' ,'value' => 'job_current' ) ) ,'options' => array( 'dateFormat' => 'yy-mm-dd' ,'firstDay' => '0' ) ) ) )); -
October 13, 2015 at 2:15 pm #4558
SteveKeymaster@justin– I’m sorry if our initial blog post wasn’t clear. We changed the array structure to make it easier for you. Any custom code you wrote targeting a specific array key will probably not work. You can now loop through this data with standard foreach loops.
We’re sorry for any confusion. But the feedback we’ve received is that making this small change now, will make things better for all Piklist developers in the future.
-
October 13, 2015 at 2:35 pm #4561
justinMemberI understand that the arrays were changed, and that is absolutely fine with me, and I think it is a lot better. I thought though that the script that 0.9.9.2 had that ran initially was suppose to change all of the old structures to the new array structure. What I am saying is that they did not change them. I would have to go into each of the user profiles and hit save in order for the array to be updated to the new structure.
I was letting you up know that the script did not seem to work. I have an ok solution right now by manually determining which type of structure it is and outputting it with the correct method. I was hoping though that you had a solution to transition all my old data to the new structure.
-
October 13, 2015 at 2:43 pm #4562
-
October 13, 2015 at 2:48 pm #4563
justinMemberYea, this is legacy user_meta from myPHPAdmin after the script was run.
a:4:{s:8:"user_job";a:1:{i:0;s:4:"3467";}s:14:"user_job_start";a:1:{i:0;s:10:"2009-09-05";}s:16:"user_job_current";a:1:{i:0;a:1:{i:0;s:7:"job_old";}}s:12:"user_job_end";a:1:{i:0;s:10:"2010-07-08";}}If I go into a profile and save a user’s profile for this field, this is what is saved to my database, in the correct format:
a:1:{i:0;a:4:{s:8:"user_job";s:4:"3695";s:14:"user_job_start";s:10:"2014-09-11";s:16:"user_job_current";a:1:{i:0;s:11:"job_current";}s:12:"user_job_end";s:0:"";}}Thanks,
-
October 13, 2015 at 4:12 pm #4566
-
October 13, 2015 at 4:23 pm #4568
justinMemberThe only other thing I can think of is that I have almost 2000 users in my database. Each user probably has 10-15 pieces of meta-data created by piklist. It said the script was successful, but maybe it error-ed out because of the size? The whole thing probably took 30 seconds, so that would be a lot of meta to zip through and update.
Would re-running the script cause any harm?
-
October 13, 2015 at 4:49 pm #4569
SteveKeymasterRerunning the script should be fine. But we still recommend backing up your data first.
-
October 14, 2015 at 11:25 am #4573
justinMemberHow would I force the rerun of the script?
Would I delete the “piklist_updates” row from my wp_options table?
I think maybe it just was not run properly, because I think my plugin was not turned on when the last update was run.
Thanks,
-
October 14, 2015 at 11:42 am #4574
SteveKeymasterCan you go to this page: yourdomain.com/wp-admin/admin.php?page=piklist_update_0_9_9
-
October 14, 2015 at 11:47 am #4575
justinMemberI am logged in as the administrator and it says “You do not have sufficient permissions to access this page.”
-
October 14, 2015 at 12:07 pm #4579
SteveKeymasterAdd this to your wp_options table:
Option Name:
piklist_updates
Option Value::a:1:{s:7:"piklist";a:1:{i:0;s:5:"0.9.9";}}That should trigger it.
-
October 14, 2015 at 1:39 pm #4580
justinMemberSo That was part of the problem. I can see that it did update some of my other fields, but it keeps failing. It just stalls, and this is what is in the debug log. I have tried running it 2 times and it keeps getting stuck here.
[14-Oct-2015 17:26:08 UTC] WordPress database error Got error 'empty (sub)expression' from regexp for query SELECT user_id FROM xs_usermeta WHERE meta_key = 'user_jobs_group' AND CAST(meta_value AS CHAR) RLIKE '' ORDER BY CAST(meta_value AS CHAR) made by do_action('wp_ajax_piklist_update_0_9_9'), call_user_func_array, Piklist_Update_0_9_9->ajax, include('/plugins/extreme-items/parts/meta-boxes/job-meta-box.php'), WP_User_Query->__construct, WP_User_Query->prepare_query, WP_Meta_Query->get_sql, apply_filters_ref_array, call_user_func_array, Piklist_WordPress::get_meta_sql, Piklist_WordPress::get_sql_for_query [14-Oct-2015 17:26:09 UTC] WordPress database error Got error 'empty (sub)expression' from regexp for query SELECT user_id FROM xs_usermeta WHERE meta_key = 'user_jobs_group' AND CAST(meta_value AS CHAR) RLIKE '' ORDER BY CAST(meta_value AS CHAR) made by do_action('wp_ajax_piklist_update_0_9_9'), call_user_func_array, Piklist_Update_0_9_9->ajax, include('/plugins/extreme-items/parts/meta-boxes/job-side.php'), WP_User_Query->__construct, WP_User_Query->prepare_query, WP_Meta_Query->get_sql, apply_filters_ref_array, call_user_func_array, Piklist_WordPress::get_meta_sql, Piklist_WordPress::get_sql_for_queryI uploaded my two files that are listed in the error logs.
https://drive.google.com/folderview?id=0BwbidsNuwyPoVEJodHdzeGZkaFU&usp=sharingthanks
-
October 14, 2015 at 2:42 pm #4587
-
October 15, 2015 at 4:29 pm #4601
KevinKeymaster@Justin-
Check out the latest version, this issue should be resolved with the latest update to the upgrade script.
Thanks,
Kevin
-
October 19, 2015 at 11:12 am #4623
justinMemberHi guys, I just tried to update my data again after updating to 0.9.9.3, and I received the this error still in my debug logs.
[19-Oct-2015 15:08:04 UTC] WordPress database error Got error 'empty (sub)expression' from regexp for query SELECT DISTINCT SQL_CALC_FOUND_ROWS xs_users.* FROM xs_users INNER JOIN xs_usermeta ON ( xs_users.ID = xs_usermeta.user_id ) WHERE 1=1 AND ( ( xs_usermeta.meta_key = 'user_jobs_group' AND CAST(xs_usermeta.meta_value AS CHAR) RLIKE '' ) ) ORDER BY user_login ASC made by do_action('wp_ajax_piklist_update_0_9_9'), call_user_func_array, Piklist_Update_0_9_9->ajax, include('/plugins/extreme-items/parts/meta-boxes/job-meta-box.php'), WP_User_Query->__construct, WP_User_Query->query [19-Oct-2015 15:08:05 UTC] WordPress database error Got error 'empty (sub)expression' from regexp for query SELECT DISTINCT SQL_CALC_FOUND_ROWS xs_users.* FROM xs_users INNER JOIN xs_usermeta ON ( xs_users.ID = xs_usermeta.user_id ) WHERE 1=1 AND ( ( xs_usermeta.meta_key = 'user_jobs_group' AND CAST(xs_usermeta.meta_value AS CHAR) RLIKE '' ) ) ORDER BY user_login ASC made by do_action('wp_ajax_piklist_update_0_9_9'), call_user_func_array, Piklist_Update_0_9_9->ajax, include('/plugins/extreme-items/parts/meta-boxes/job-side.php'), WP_User_Query->__construct, WP_User_Query->query -
October 19, 2015 at 2:51 pm #4629
SteveKeymaster@justin– Is this an install we can log into? If so, we’d appreciate if you could email some log in info. We would need WP, FTP and DB access. Email to [email protected]
-
October 21, 2015 at 9:11 pm #4669
-
-
AuthorPosts
- The topic ‘Add More + GROUP data not correct [0.9.9.2]’ is closed to new replies.