Reviews disappeared after upgrade

Posted in: Newspaper
Post count: 45

Hi,

today I upgraded from Newspaper 4 to Newspaper 8.

What I noticed is that all my reviews are completely gone.
They are still in the database fortunately (wp_postmeta -> metakey td_review) but I am unable to understand how to make the theme load them back from the database.

I hope you can help me out, this is really important for us!

Thanks

Post count: 20685

Hi,

Please send us an email at contact@tagdiv.com and we will try to give you a solution. Provide admin login information and FTP access. Also paste a link to this topic, so we can identify you.

Thanks

Post count: 45

Thank you, I just sent an email with all the details

Post count: 45

Thanks for the follow-up via mail. To sum-up the problem:

If on td_first_install.php I use the code

// empty -> any version
if (!empty($td_db_version)) {
// wp_parse_args format
$args = array(
'post_type' => array('page', 'post'),
'numberposts' => '10',
'offset' => 0,
'orderby' => 'post_date',
'order' => 'DESC',
'meta_query' => array(
'relation' => 'OR',
array('key' => 'td_homepage_loop_filter'),
array('key' => 'td_unique_articles'),
array('key' => 'td_smart_list'),
array('key' => 'td_review')
),
'update_post_term_cache' => false,
);

I get the error

Warning: Invalid argument supplied for foreach() in /home/laplayst/public_html/wp-content/themes/Newspaper/includes/wp_booster/td_first_install.php on line 313

which refers to the line

foreach ($td_review[0] as $filter_key => $filter_value) {

I am not sure where the error is, I am running PHP 5.6 and even if my plugins are disabled the problem persists.

I know it’s the weekend but I hope someone will be able to help before the beginning of next week 🙁

Post count: 45

I additionally realized that if I process 2000 items at the time, I get the error message 949 times.

If through phpmyadmin I go and check how many entries have a td_review field, they are 475, exactly half of it.

Wouldn’t it also be possible to fix the problem with an sql query?

Post count: 45

I solved the problem by using the following SQL query:

UPDATE wp_postmeta dt1, wp_postmeta dt2
SET dt1.meta_value = dt2.meta_value
WHERE dt1.post_id = dt2.post_id AND dt1.meta_key = "td_post_theme_settings" AND dt2.meta_key = "td_review"

Post count: 27

Thanks for resolving SnakeEater – and posting your results. We did exactly as you suggested and it worked for us too – really very much appreciated.

Rich

Post count: 1341

Hello!

After executing this SQL query:

UPDATE wp_postmeta dt1, wp_postmeta dt2
SET dt1.meta_value = dt2.meta_value
WHERE dt1.post_id = dt2.post_id AND dt1.meta_key = "td_post_theme_settings" AND dt2.meta_key = "td_review"

reviews will appear on the website? Right?

How to correctly run the SQL query on the website running C-Panel?

Post count: 27

yep, they’ll appear on the website. Sorry mate, no idea how to execute it tho – i got a dude on peopleperhour to do it for me.

Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.