Project

General

Profile

Actions

Bug #11122

closed

Recurrence of incorrect blog_title meta updating

Added by Boone Gorges about 5 years ago. Updated about 5 years ago.

Status:
Resolved
Priority name:
High
Assignee:
Category name:
Blogs (BuddyPress)
Target version:
Start date:
2019-02-18
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

My logging scripts turned up that #10738 has come back. Here's the relevant parts of the request:

    [REQUEST_URI] => /wp-json/wp/v2/posts/45?_locale=user
    [HTTP_X_HTTP_METHOD_OVERRIDE] => PUT

which probably comes from Gutenberg, given the REFERER.

This triggers the following series of queries (this is an excerpt):

 [33] => Array
        (
            [0] => SELECT DISTINCT a.id  FROM wp_bp_activity a  WHERE a.component IN ( 'blogs' ) AND a.type IN ( 'new_blog_comment' ) AND a.secondary_item_id IN ( 8,7,6,4,3 ) AND a.is_spam = 0 AND a.type NOT IN ('activity_comment') AND a.date_recorded <= '2019-02-19 00:20:03' ORDER BY a.date_recorded DESC, a.id DESC LIMIT 0, 100000
            [1] => 0.012861967086792
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_get, BP_Activity_Activity::get
        )

    [34] => Array
        (
            [0] => SELECT * FROM wp_bp_activity WHERE id IN (560433,560434,560104,560053,560033,559899,559683,559581,560435,559368,559241,559210,559078,560436,558847,559621,557579,557296,557182,556824,556482,556509,556294,555866,555505,555269,555221,554957,554956,555054,554948,556636,556637,554800,554679,554676,554658,554196,554181,553673,553665,553441,553422,553310,553264,552929,552808,552803,552725,551907,551908,551902,546848,546846,546340,543937,540299,538442,538359,538358,538265,538264,536808,536806,536796,536645,536644,534994,531622,530326,546779,529498,529499,529255,528756,528250,526770,525854,524319,524032,524031,524004,523879,523696,523697,523695,523922,523932,523933,523924,522909,524250,521672,519722,519721,519720,519336,519329,519156,518609,518915,518538,518498,518341,518150,518142,518148,518057,518056,518040,518021,517864,516267,516266,516269,516270,515978,515894,515885,515849,515737,516264,515319,514818,514816,514810,514804,514800,514709,514619,514447,507718,511476,503967,503933,503968,503887,503886,503842,503826,501396,501392,501343,502458,500530,500529,500528,500519,500518,500247,500083,500084,500086,500087,498085,497829,497320,496808,496667,495185,493306,493253,493206,493181,493169,493162,492887,492705,492552,491921,491801,490968,490960,490929,490919,490896,490630,490627,490616,490553,490522,490504,490523,490524,490491,489961,489962,489727,489720,489793,489795,489595,489587,489358,489298,489268,489264,489265,489150,489142,489137,489107,489092,489078,489068,489067,489024,489023,489102,488993,488981,488977,488933,489000,488926,488921,488877,488815,488985,488803,488986,488348,486583,477582,474713,474031,473983,473982,473980,473979,473687,473658,473649,473584,473583,473415,473405,473406,473359,473349,473360,473200,473201,472291,472160,472159,472158,472156,472155,472075,472051,471301,470625,470606,470605,470527,470517,470514,470450,470446,470442,470443,470434,470399,470379,469941,469832,469846,469766,469649,469647,469154,469151,467714,467418,467414,467411,465360,464910,464598,464232,464231,464195,464201,464202,464186,464084,464082,462552,462551,460260,459245,458975,456921,456177,455964,455902,455897,455666,455266,455188,455117,455082,455057,455050,455049,454989,454960,454270,454269,454264,454238,454181,454216,453516,453124,453335,453059,452841,452840,449298,449297,449229,448730,448215,447933,447715,447623,446272,445763,445762,444726,443628,443525,442870,443816,442608,442372,442041,441968,441849,441671,441672,441673,441600,441593,441585,441527,441505,441506,441476,441517,441507,441455,441302,441456,441224,441210,441157,441126,441119,441006,440988,440972,440760,440699,440698,440630,440561,440016,440033,440005,439890,439787,439738,439085,437904,437903,437902,437889,444002,435845,435847,435846,432763,431073,431063,430763,429979,429978,428672,428209,428202,428166,426920,426794,426793,426792,426769,426768,426739,426727,426723,426597,426578,426579,426598,427225,429975,421452,420525,420522,420520,420518,420517,419213,419211,418691,418015,417981,417936,416652,416487,416488,415936,415880,415704,415357,415356,415123,411997,411992,411991,411979,411990,411850,411745,411744,411118,410765,410763,410541,410010,410008,409986,409987,409606,409201,404899,397890,394028,367715,411529,411528,424613,356936,356934,356933,350118,347629,347457,345910,344253,343873,343855,343335,343336,341008,340938,340827,340188,340187,333926,330812,330811,330788,330088,329739,329410,329379,328568,328567,328456,327922,327894,327774,327483,327277,327020,326838,326436,326386,326466,326427,326353,326293,326012,325925,325893,325871,325371,325350,325330,325892,325208,324172,323720,323708,322913,322904,328108,321174,311481,311012,310758,310718,310618,309498,308750,308368,308061,308000,416682,307074,305762,305614,305269,304971,304955,304886,304871,304967,304968,304800,304796,304795,304687,304554,304549,304541,304509,304241,304226,304029,303994,303979,303958,303923,303265,303219,303066,302959,302863,300028,299966,299494,299243,299244,291295,282342,282341,281080,265692,265683,264787,264262,264263,261026,255123,253461,253173,253144,252626,251200,251092,250843,251093,250726,250724,250722,249266,248798,248797,248792,247637,247443,247442,236130,235876,235875,235873,234247,234246,250222,231972,231971,231819,231818,226728,226229,226225,225886,225847,225834,225973,225638,225240,224810,223958,223328,222865,311104,222201,222113,222007,221908,221894,221722,221652,224930,221428,239933,220907,220904,220446,220333,220327,219929,219920,219886,219885,219881,219812,219618,218364,213924,213298,213239,213186,212929,212928,212719,213256,212573,212572,213255,212078,211223,210925,210499,209545,209122,209121,208909,208908,207151,207050,206873,311105,205688,203008,202013,201810,200367,202001,200360,200359,200303,199833,199855,199832,197859,197740,202003,196725,196738,196414,196298,196179,195993,200471,196088,196089,194796,194765,195539,195540,195541,195543,193760,193613,193463,193437,193351,193347,193346,193344,193343,193342,193575,193338,193418,196181,193082,200472,192468,192453,192328,192053,193201,191931,192119,191598,191516,191437,193419,191009,191210,190908,190936,191592,191593,191108,193350,190898,190793,190576,190469,190358,190935,189312,188727,188390,188335,187393,187389,187390,186555,181812,183112,192495,178794,177459,173349,166688,166689,156965,143340,140370,137297,132713,127185,117812,106396,100841,95631,93859,93860,92032,89904,88288,86020,85496,85470,85495,84979,84361,84083,83809,83007,82995,82562,82324,82025,81799,81732,80598,80590,80518,80292,80185,80155,80153,80152,80142,80136,80121,80086,80050,79917,79199,79058,79057,78602,78601,78600,78598,78580,80138,78258,78257,78259,77651,77649,77418,76422,75454,76423,74905,74301,74238,73846,73762,73761,74300,72904,72892,72778,72567,72490,72285,71778,71692,70946,70006,68592,68394,67500,67494,67286,67232,67167,199515,66359,65833,65297,65112,64804,64788,64726,64716,64710,64199,64125,63808,63760,63467,63335,63277,63242,63087,62963,62389,62339,62235,62204,61776,63634,61750,61749,61122,60559,59506,59466,58723,65296,57992,57965,57400,57414,57415,57416,56983,56984,56985,57401,57402,56941,56800,56798,56797,56788,56616,56611,63635,56610,56350,56239,56176,56108,56008,55834,56773,55889,55846,55433,55159,55152,55150,55122,55104,54895,54663,55347,54608,54483,54677,54016,53780,53576,53445,53321,53344,53128,52496,52421,52365,52497,52257,52258,54745,54746,66026,51665,51290,51143,51103,51070,50893,50892,50639,50460,50417,50219,49418,49282,49051,48954,50215,48579,48480,48476,66025,48058,47755,47566,47545,47331,47227,47134,47031,46998,46997,46618,46420,46175,45858,45843,45617,45480,45479,45283,45257,45214,45200,45161,45129,44962,44946,44945,44566,44565,44526,44434,44411,44395,44345,44286,44979,43838,43446,43444,41167,41090,41089,41060,40687,38453,38450,38340,38067,38027,37971,37859,37858,37332,37331,37242,38550,36689,36570,36540,36504,38552,38553,36368,36011,36007,36006,35905,35914,35816,35578,35577,35488,35489,35487,35451,34926,34507,33785,33786,34218,33263,33236,33201,33158,33125,32873,32869,32858,32730,32635,32575,32573,32574,32572,32340,32166,32090,31925,31920,31270,31278,31261,31260,31198,31219,31194,31311,31132,31121,31540,31101,30919,30918,30629,30601,30600,30616,30602,30655,30897,14047,13959,13932,13427,13157,13004,12846,12831,77652)
            [1] => 0.16637110710144
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_get, BP_Activity_Activity::get, BP_Activity_Activity::get_activity_data
        )

    [39] => Array
        (
            [0] => SELECT activity_id, meta_key, meta_value FROM wp_bp_activity_meta WHERE activity_id IN (560433) ORDER BY id ASC
            [1] => 0.00059795379638672
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_get, BP_Activity_Activity::get, BP_Activity_Activity::generate_action_strings, bp_activity_generate_action_string, apply_filters('bp_activity_generate_action_string'), WP_Hook->apply_filters, bp_blogs_format_activity_action_new_blog_comment, bp_activity_get_meta, get_metadata, update_meta_cache
        )

    [40] => Array
        (
            [0] => SELECT activity_id, meta_key, meta_value FROM wp_bp_activity_meta WHERE activity_id IN (560434) ORDER BY id ASC
            [1] => 0.0015859603881836
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_get, BP_Activity_Activity::get, BP_Activity_Activity::generate_action_strings, bp_activity_generate_action_string, apply_filters('bp_activity_generate_action_string'), WP_Hook->apply_filters, bp_blogs_format_activity_action_new_blog_comment, bp_activity_get_meta, get_metadata, update_meta_cache
        )

    [41] => Array
        (
            [0] => SELECT activity_id, meta_key, meta_value FROM wp_bp_activity_meta WHERE activity_id IN (560104) ORDER BY id ASC
            [1] => 0.00064301490783691
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_get, BP_Activity_Activity::get, BP_Activity_Activity::generate_action_strings, bp_activity_generate_action_string, apply_filters('bp_activity_generate_action_string'), WP_Hook->apply_filters, bp_blogs_format_activity_action_new_blog_comment, bp_activity_get_meta, get_metadata, update_meta_cache
        )

....

 [1993] => Array
        (
            [0] => UPDATE `wp_bp_activity_meta` SET `meta_value` = 'Week 3 Reflections' WHERE `activity_id` = '416652' AND `meta_key` = 'post_title'
            [1] => 0.00072002410888672
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_update_meta, update_metadata
        )

    [1994] => Array
        (
            [0] => SELECT id FROM wp_bp_activity_meta WHERE meta_key = 'post_title' AND activity_id = 416487
            [1] => 0.00072813034057617
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_update_meta, update_metadata
        )

    [1995] => Array
        (
            [0] => UPDATE `wp_bp_activity_meta` SET `meta_value` = 'Week 3 Reflections' WHERE `activity_id` = '416487' AND `meta_key` = 'post_title'
            [1] => 0.00062012672424316
            [2] => require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Posts_Controller->update_item, wp_update_post, wp_insert_post, wp_transition_post_status, do_action('transition_post_status'), WP_Hook->do_action, WP_Hook->apply_filters, bp_activity_catch_transition_post_type_status, bp_activity_post_type_update, do_action('bp_activity_post_type_updated'), WP_Hook->do_action, WP_Hook->apply_filters, bp_blogs_update_post_activity_meta, bp_activity_update_meta, update_metadata
        )

It looks like the hotfix was lost when we updated BuddyPress in https://github.com/cuny-academic-commons/cac/commit/68ff3952ad23f37fe4fdd93eae690db125fd7d25. Was the fix not included in 4.1.0 as indicated in https://buddypress.trac.wordpress.org/changeset/12311? Could you please have a look to figure out what happened?

Update - it looks like it was not in fact part of 4.1.0. Not sure how this happened. https://buddypress.trac.wordpress.org/ticket/8007#comment:5

Ray, would you mind reapplying the hotfix and then running your fix script again?


Related issues

Related to CUNY Academic Commons - Bug #10738: BP blogmeta update routine incorrectly overwrites 'post_title' for unrelated activitiesResolvedRaymond Hoh2018-11-20

Actions
Actions #1

Updated by Boone Gorges about 5 years ago

  • Related to Bug #10738: BP blogmeta update routine incorrectly overwrites 'post_title' for unrelated activities added
Actions #2

Updated by Boone Gorges about 5 years ago

  • Description updated (diff)
Actions #3

Updated by Raymond Hoh about 5 years ago

  • Status changed from New to Resolved

Reapplied hotfix on production - https://github.com/cuny-academic-commons/cac/commit/d89e350e96a1c9a906b5ef2cea9ca76758db5078

Ran the WP-CLI script again. Took awhile, but looks like everything synced.

Actions #4

Updated by Boone Gorges about 5 years ago

Heroic. Thank you, Ray. I'll clean up the mess on the BP side.

Actions

Also available in: Atom PDF