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

the cctm plugin was unable to determine the id of the related item. avoid using alternate sizes of images #510

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 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. create media custom field related to a content type
2. select upload
3. select from url
4. put title and link
5. always got "the cctm plugin was unable to determine the id of the related 
item. avoid using alternate sizes of images"

What is the expected output?

What do you see instead?
always got "the cctm plugin was unable to determine the id of the related item. 
avoid using alternate sizes of images"

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

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.):

Original issue reported on code.google.com by parama.d...@gmail.com on 31 Jul 2013 at 12:31

GoogleCodeExporter commented 9 years ago
Probably this is a duplicate of Issue #421: adding from link is not supported 
because there is no foreign key that the CCTM can read because the item is not 
in the database.  Ideally I'd remove that option from the upload dialog, but 
WordPress has made it nearly impossible to reuse any of their code.

The only solutions here I can think of are as follows:

1. Add an FAQ explaining why this does not work (i.e. you can only have a 
foreign key relation it the items actually exist)
2. OR Attempt to remove that tab from the lightbox (difficult given WP's 
complete lack of sensible architecture)
3. OR attempt to detect when a link is added, then dynamically create a media 
item on the fly.  This is tricky because we would have no meta data about that 
image and there's the possibility of that the URL already exists in the 
database.  There's also the possibility of a security threat if the "image" 
that is linked to is actually a dynamic file that generates code.

Original comment by ever...@fireproofsocks.com on 31 Jul 2013 at 3:52

GoogleCodeExporter commented 9 years ago
Any update son this issue?

Original comment by daria.ab...@gmail.com on 23 Oct 2013 at 2:39

GoogleCodeExporter commented 9 years ago
The only reliable way to "fix" this is to rewrite the WordPress core 
functionality, and building an asset uploader/management tool is a massive 
undertaking.  Barring that, I'd fall back to item #1 above.

Original comment by ever...@fireproofsocks.com on 23 Oct 2013 at 3:03

GoogleCodeExporter commented 9 years ago
Sorry just noticed my issue is not the same one posted above - I am basically 
uploading a new image when i click insert into post I get "the cctm plugin was 
unable to determine the id of the related item. avoid using alternate sizes of 
images"

Then is I just click on choose image it lets me select the image but not the 
size I want in fact it takes it's original full size which I don't want.

Original comment by daria.ab...@gmail.com on 23 Oct 2013 at 3:15

GoogleCodeExporter commented 9 years ago
It's possible that WP has once again changed its HTML for images.  Will review.

Original comment by ever...@fireproofsocks.com on 23 Oct 2013 at 3:23

GoogleCodeExporter commented 9 years ago
*SYSTEM INFO* 
------------------------ 
Plugin Version: 0.9.7.11-pl
WordPress Version: 3.6.1
PHP Version: 5.4.7
MySQL Version: 5.5.25
Server OS: WINNT
Language: 
------------------------ 
ACTIVE PLUGINS: 
------------------------ 
CURRENT THEME: Twenty Thirteen v.1.0 http://wordpress.org/themes/twentythirteen

Just in case this helps

Original comment by daria.ab...@gmail.com on 23 Oct 2013 at 3:28

GoogleCodeExporter commented 9 years ago
Do let me know if you have any updates for me,

Thanks.

Original comment by daria.ab...@gmail.com on 25 Oct 2013 at 9:13

GoogleCodeExporter commented 9 years ago
I'm trying to fix this, I don't think WP changes the HTML for images. I'm 
trying to understand how your plugin works internally, I would appreciate if 
you let me know when you have an update for this.

Original comment by daria.ab...@gmail.com on 31 Oct 2013 at 5:05

GoogleCodeExporter commented 9 years ago
For updates, subscribe to the issue -- I'll work on it as I'm able.  Re the 
functionality here: it's rocky because the WP architecture here is cludgy, and 
the plugin is attempting a workaround.  Instead of passing a raw ID, WP passes 
an HTML block (i.e. it does this whole thing in a way that was clearly never 
conceived of being reused in any other context other than for the narrow-minded 
one for which it was conceived).  That makes this whole thing very difficult: 
there's a regular expression in one of the javascript files that attempts to 
tease the post ID out of the HTML that WordPress sends.

See the custom-content-type-manager/js/relation.js file: there are comments in 
there at the top.  The function in question is cctm_upload().  

Original comment by ever...@fireproofsocks.com on 31 Oct 2013 at 5:19