freaking1 / wordpress-custom-content-type-manager

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

Absolute pathing is saved in wp_options #559

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When moving a site to a new server setup, the config stored in wp_options 
stores the absolute path. This causes numerous issues when changing the file 
pathing on the new server. 

What steps will reproduce the problem? (Be *specific*)
1. Install and setup as normal. (Add content to see the issue.)
2. Move site to a new setup and import the DB (for me, original had no 
public_html but the new setup does)
3. Try to access any part of CCTM or any page that uses it.. (you get errors 
due to the pathing being hard-coded.)

What is the expected output?
Pathing should not be hard-coded. Site should transfer fine irrelevant of the 
pathing. Everything should work and appear normal.

What do you see instead?
PHP warnings for failed to open stream.

Warning: 
require_once(/var/www/vhosts/funimation.tv/wp-content/plugins/custom-content-typ
e-manager/fields/dropdown.php): failed to open stream: No such file or 
directory in 
C:\Sites\funimation.tv\wp-content\plugins\custom-content-type-manager\includes\C
CTM.php on line 2022

Does the problem continue if you disable all other plugins? (plugin
conflicts cause a LOT of problems, so please isolate the problem)
No, this is strictly a bug with this plugin. All other sites migrated fine.

The fix would be to store relative pathing over absolute... You really don't 
need anything before the plugins directory pathing... 

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.9.1
PHP Version: 5.4.9-4ubuntu2.4
MySQL Version: 5.5.34-0ubuntu0.13.04.1-log
Server OS: Linux
Language: 
------------------------ 
ACTIVE PLUGINS: 
 * 404 Redirected v.1.3.2 [http://www.weberz.com/plugins/404-redirected/]
 * All In One SEO Pack v.2.1.5 [http://semperfiwebdesign.com]
 * Custom Content Type Manager : Advanced Custom Post Types v.0.9.7.13 [http://code.google.com/p/wordpress-custom-content-type-manager/]
 * Disqus Comment System v.2.74 [http://disqus.com/]
 * Easy Bootstrap Shortcode v.4.2.0 [http://www.oscitasthemes.com]
 * Google Analytics for WordPress v.4.3.5 [http://yoast.com/wordpress/google-analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=wpgaplugin&utm_content=v420]
 * Gravity Forms - Placeholders add-on v.1.2.1 [http://github.com/neojp/gravity-forms-placeholders/]
 * Gravity Forms v.1.8.7 [http://www.gravityforms.com]
 * Gravity Forms MailChimp Add-On v.2.4 [http://www.gravityforms.com]
 * Olympusat Shows Schedule Updater v.1.0 []
 * Olympusat Timer Class v.1.0 []
 * Tweet, Like, Google +1 and Share v.1.7.4 [http://techxt.com/tweet-like-google-1-and-share-plugin-wordpress/]
 * Post Types Order v.1.6.8 [http://www.nsp-code.com]
 * Simple Image Sizes v.3.0 [https://github.com/Rahe/'simple-image-sizes']
------------------------ 
CURRENT THEME:  v. 

Original issue reported on code.google.com by son9ne.j...@gmail.com on 27 May 2014 at 3:33

GoogleCodeExporter commented 9 years ago
This is a much bigger issue: Wordpress stores absolute paths and URLs 
throughout the database.  The problem really is that Wordpress does not offer 
sensible configuration options: unlike other CMS apps, WP does not include 
config options for the install path and the install URL.  Some of these you can 
work around, other values are stored in the database, so WP migrations are a 
bit rough by comparison.

When migrating sites, the correct approach is to export your content type 
definitions to a JSON file (see Custom Content Types --> Tools).  Save the file 
and then on the new server, import the definition.  This is outlined in the 
FAQ: 
https://code.google.com/p/wordpress-custom-content-type-manager/wiki/FAQ#Everyth
ing_Broke_after_Moving_my_Site!

The new version of the plugin will handle this more gracefully, but for now 
there is a workflow established already that solves this problem.

Original comment by ever...@fireproofsocks.com on 27 May 2014 at 3:52