chnovo7 / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
0 stars 0 forks source link

Bug (possibly?) in 'merge' function #546

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please make sure you are including enough information to make this a valid
bug report: https://code.google.com/p/wordpress-custom-content-type-
manager/wiki/ReportingBugs

What steps will reproduce the problem? (Be *specific*)
1. Use of the merge function in Custom Fields to merge one field into another

What is the expected output?

(1) Field being merged from will disappear; (2) Field being merged to will be 
adjusted as / if necessary - e.g. associated content types updated to include 
merged from field's association, if different to merged to's. (3) Instances of 
'merged from' meta_key' in WP database changed to 'merged to' meta_key

What do you see instead?

(1) and (2) seems to be working fine (or 'as expected'); However (3) not 
performed. Instances of 'merged from' meta_key remain unchanged, so effectively 
a post appears to have no value for the 'merged to' field.

Does the problem continue if you disable all other plugins? (plugin
conflicts cause a LOT of problems, so please isolate the problem)

Yes. (Also, used the 'Clear Cache' function prior to performing a merge, though 
doubt that would affect anything! Didn't .. or at least didn't resolve the 
issue.) Have NOT tried switching to 2014 theme yet, but again don't actually 
see how that might affect things.

Please copy and paste the system information that appears in a yellow
textarea when you click on "Report a Bug" on any CCTM admin screen (this
includes the version of the
plugin, the version of PHP, the version of MySQL, a list of other active
plugins etc.):

*SYSTEM INFO* 
------------------------ 
Plugin Version: 0.9.7.13-pl
WordPress Version: 3.8.1
PHP Version: 5.3.1
MySQL Version: 5.1.41
Server OS: WINNT
Language: 
------------------------ 
ACTIVE PLUGINS: 
 * Add Functions v.0.2 [http://tigor.me/add-functions/]
 * Admin Menu Editor v.1.3.1 [http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/]
 * Admin Toolbar Menus v.1.0.1 [http://gowebben.com]
 * Akismet v.2.5.9 [http://akismet.com/?return=true]
 * All In One SEO Pack v.2.1.4 [http://semperfiwebdesign.com]
 * Bad Behavior v.2.2.15 [http://bad-behavior.ioerror.us/]
 * Codepress Admin Columns v.2.1.2 [http://www.codepresshq.com/wordpress-plugins/admin-columns/]
 * Custom Content Type Manager : Advanced Custom Post Types v.0.9.7.13 [http://code.google.com/p/wordpress-custom-content-type-manager/]
 * Custom Post Limits v.3.6 [http://coffee2code.com/wp-plugins/custom-post-limits/]
 * Duplicate Post v.2.6 [http://lopo.it/duplicate-post-plugin/]
 * Google Rank Badge v.1.0 [http://www.nickpowers.info]
 * Google XML Sitemaps v.3.4 [http://www.arnebrachhold.de/redir/sitemap-home/]
 * Multi-column Tag Map v.12.0.4 [http://tugbucket.net/wordpress/wordpress-plugin-multi-column-tag-map/]
 * Page Columnist v.1.7.3 [http://www.code-styling.de/english/development/wordpress-plugin-page-columnist-en]
 * PHP Code for posts v.1.2.0 []
 * Query Multiple Taxonomies v.1.6.2 [http://scribu.net/wordpress/query-multiple-taxonomies]
 * Random Image Selector v.1.5.6 [http://kdmurray.net/2008/12/17/random-image-selector-150-released/]
 * Random Text v.0.3.0 [http://www.pantsonhead.com/wordpress/randomtext/]
 * Related Links v.1.7.1 [http://wordpress.org/extend/plugins/related-links/]
 * Relevanssi v.3.3.4 [http://www.relevanssi.com/]
 * Simple Taxonomy v.3.5 [https://github.com/herewithme/simple-taxonomy]
 * Sort Query Posts v.1.1 [http://wordpress.org/extend/plugins/sort-query-posts]
 * Term Management Tools v.1.1.3 [http://scribu.net/wordpress/term-management-tools]
 * Form Manager v.1.6.46 [http://www.campbellhoffman.com/form-manager/]
 * WP Simple Survey v.3.0.0 [http://www.sailabs.co/products/wordpress-simple-survey/]
 * WP Better Emails v.0.2.6.4 [http://wordpress.org/extend/plugins/wp-better-emails/]
 * WP Database Optimizer Tools v.0.2 [http://xtremenews.info/wordpress-plugins/wp-database-optimizer-tools/]
 * WP Ultimate CSV Importer v.3.5.1 [http://www.smackcoders.com/wp-ultimate-csv-importer-pro.html]
------------------------ 
CURRENT THEME: S-t-u-f-f v.1.0 
http://www.s-t-u-f-f.net/wp-content/themes/s-t-u-f-f/

It's not 'life threatening' or urgent ... I can change the 'merged from' 
meta_keys to 'merged to' manually. Just thought I should report it in case it's 
not just me / my set-up that's having this problem. And of course if there's a 
quick and easy solution, it'll save me quite a bit of time, as I've lots of 
fields to merge!

Additional Info: Not sure if this will / does affect things, but this behaviour 
is happening on a site I'm working on OFF line, using a serverpress.com 
DESKTOPSERVER (virtual server). Have to admit, I haven't yet tried the same 
action on the live ON line server .. mainly because I think I'll get confused! 
Also, because that would mean that things that currently work won't until I 
resolve the issue. :-) Usually, everything appears to work identically on the 
ON and OFF line servers, though I HAVE very recently had one instance of 
something working OK ON line, but not OFF (a simple plugin upgrade, where the 
'automatic' upgrade failed offline so I had to download the zip file and 
upgrade it manually).

Original issue reported on code.google.com by kevin...@gmail.com on 12 Mar 2014 at 9:32

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Just realised it is renaming meta_keys: It's renaming the TO meta_key to 
"target_value". Still not insurmountable manually, but a bit more of a pain as 
I'll need to manually run the change on the MYSQL database after each 'merge', 
rather than doing all the merges in WP, then all the renaming in MYSQL 
(because, obviously, all of the meta_key fields are being renamed to the same 
thing).

Could this be something as simple as different MYSQL versions, where the 
version(s) the plugin is written for uses a different syntax to the version on 
my offline server? In case that sounds likely/possible, my offine server 
version info is ...

DATABASE SERVER:
Software: MySQL
Software version: 5.1.41 - Source distribution
Protocol version: 10
User: root@localhost
Server charset: UTF-8 Unicode (utf8) 

WEBSERVER:
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color 
PHP/5.3.1
Database client version: libmysql - 5.1.41
PHP extension: mysql 

Original comment by kevin...@gmail.com on 12 Mar 2014 at 10:31

GoogleCodeExporter commented 8 years ago
I've just tried the same operation on the live database - it appears to have 
the same result:

Merging field1 (meta_key = "1") into field2 (meta_key = "2") results in field1 
meta_key staying the same at "1", field2 meta_key changed to "target_value".

The MYSQL version on the live server is 5.5.35

I can give you access to both the site admin side and to the database if you 
want \ need it. (Though I'll have to think for a few minutes for the latter ... 
never done that before! :-) ) Let me have an email address to send logon 
credentials and a couple of simple pleas to, if so.

Original comment by kevin...@gmail.com on 12 Mar 2014 at 11:35

GoogleCodeExporter commented 8 years ago
Thanks for the report.  

To fix: controllers/merge_custom_fields.php line 37 should read:

$query = $wpdb->prepare("UPDATE {$wpdb->postmeta} SET meta_key=%s WHERE 
meta_key=%s;"
            , $_POST['merge_target']
            , $field_name);

Committed revision 873985.

Original comment by ever...@fireproofsocks.com on 12 Mar 2014 at 11:58

GoogleCodeExporter commented 8 years ago
Wow! What a fantastically quick response and fast resolution! No wonder CCTM is 
one of my two all-time favourite and 'can't live without' plugins. :-)

Have applied the fix, tested it, and it seems to work perfectly. :-)) And 
before I'd even really started my manual journey.

Many, many, many thanks! :-))

Original comment by kevin...@gmail.com on 12 Mar 2014 at 12:14