google-code-export / wordpress-custom-content-type-manager

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

Unencoded CCTM_URL is breaking javascript paths and creating issues with custom select fields #453

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The problem is easy to recreate.  Go into Custom Content Type Manager and try 
to create a custom field that is a select box.  Go down to options and click 
the add button...nothing happens.  Even if you manually add options with pipes 
this isn't accepted.

The issue is that custom content type manager changed their dir name to say:

"custom-content-type-manager 3" (note the space)

So this URL fails: 
http://abc.com/wp-content/plugins/custom-content-type-manager3/js/dropdown.js?ve
r=3.5

But not this one: 
http://abc.com/wp-content/plugins/custom-content-type-manager%203/js/dropdown.js
?ver=3.5

Dropdown.js is not the only javascript reference that is broken because of this.

Any reference that uses CCTM_URL will be messed up.

My fix was to open: /wp-content/plugins/custom-content-type-manager 
3/includes/constants.php

Comment out: 

define('CCTM_URL', plugins_url() .'/'. basename( CCTM_PATH ) );

And replace it with: 

define('CCTM_URL', 
'http://abc.com/wp-content/plugins/custom-content-type-manager%203' );

I'm sure there are nicer fixes available...but this worked perfectly for me.

Original issue reported on code.google.com by aa...@ad-lit.com on 30 Jan 2013 at 7:18

GoogleCodeExporter commented 9 years ago
I modified the line:

define('CCTM_URL', plugins_url() .'/'. rawurlencode(basename(CCTM_PATH)) );

Committed revision 661429.

Original comment by ever...@fireproofsocks.com on 30 Jan 2013 at 11:15