Media credit doesn't display if no caption present
-
I’ve recently installed Media Credit, and it works well except for one thing: When I try to include a media credit with images that have no caption, the credit does not usually display. (Occasionally it does.)
-
What version of WP? Which theme? Do you have a screenshot (or better yet, an example page)? What does the inserted shortcode (HTML view) look like exactly?
Thanks for the quick reply. The WP version is 4.5.3. The theme is a customization of the WPZoom “Tribune” theme.
The credit info does not save at all when I hit “update”, and the little circle of doom adjacent to the credit box just keeps spinning. The inserted shortcode does not show up at all, in either the html or Visual views. Here’s the html for the photo:
<img class=”aligncenter wp-image-9802 size-full” src=”https://www.theopennotebook.com/wp-content/uploads/2016/03/shutterstock_182727164.jpg” alt=”shutterstock_182727164″ width=”1800″ height=”1523″ />This problem ONLY occurs when I try to insert a credit on images with no caption, and I’ve tried it in several different posts.
Thanks…
Do you see an error in the JS console?
Hmmm…I have no idea what that means. Can you clue me in?
Which browser do you use? In most, there is an entry in the context menu called “inspect” or “examine”. This opens a debugging view where on of the tabs is called “Console” or something similar. If there is an error in the JavaScript code, it will show up there.
OK. Looking at the inspect area relevant to that photo, in console view I do see a lot of errors, but I have no idea how to interpret it, or if it’s relevant to this issue. (I’m using Chrome, on a Mac.)
I’m copying and pasting the text here:
WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403
load-scripts.php:4 The specified value “” does not conform to the required format. The format is “#rrggbb” where rr, gg, bb are two-digit hexadecimal numbers.
public-api.wordpress.com/:451 WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403
/wp-content/plugins/media-credit/admin/js/tinymce4/media-credit-tinymce.js?wp-mce-4310-20160418:796 Uncaught TypeError: Cannot read property ‘attr’ of undefined
public-api.wordpress.com/:451 WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403
load-scripts.php:4 The specified value “” does not conform to the required format. The format is “#rrggbb” where rr, gg, bb are two-digit hexadecimal numbers.
2public-api.wordpress.com/:451 WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403
/wp-content/plugins/media-credit/admin/js/tinymce4/media-credit-tinymce.js?wp-mce-4310-20160418:796 Uncaught TypeError: Cannot read property ‘attr’ of undefined
16public-api.wordpress.com/:451 WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403
load-scripts.php:4 The specified value “” does not conform to the required format. The format is “#rrggbb” where rr, gg, bb are two-digit hexadecimal numbers.
/wp-content/plugins/media-credit/admin/js/tinymce4/media-credit-tinymce.js?wp-mce-4310-20160418:796 Uncaught TypeError: Cannot read property ‘attr’ of undefined
3public-api.wordpress.com/:451 WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403
load-scripts.php:4 The specified value “” does not conform to the required format. The format is “#rrggbb” where rr, gg, bb are two-digit hexadecimal numbers.
3(index):451 WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed: Error during WebSocket handshake: Unexpected response code: 403No, you are right, that does not look like it’s related to the problem with Media Credit. It might cause the JS to fail, but then again, if you can insert
[media-credit]
when there is a caption, that seems unlikely. When you try to insert the shortcode, what exactly is inserted in the HTML view? Just the image tag?I can’t really reproduce this here. Have you tried whether the problem also occurs when you change your theme to one of the stock ones, e.g. Twenty Sixteen?
Nothing appears at all when I try to save the credit — and so nothing appears in the HTML view. It simply doesn’t save, and the “credit” box remains blank.
I’ve done a lot of customizations to my theme, so I don’t want to try switching to a different one to test this. I’m surprised no one else has run across this problem before!
Are you talking about inserting a credited image into a post from the editor or about setting a credit for an image?
As for the theme switching: It wouldn’t be about a permanent switch, but if it works with Twenty Sixteen, odds are that there is some sort of incompatibility with the theme or some of your customizations. As you are using a non-free (or at least not publicly available) theme, I can’t reproduce the same environment here to test the exact situation.
I see. I may try that, but am skittish about the possibility of messing up any theme customizations by deactivating it.
To answer your question, I’m taking about a situation where I have uploaded a photo into a post, using the “Add Media” button, and now I want to type in credit information for it. In many cases these are stock images that are purely decorative, so I don’t need/want captions–but do need to appropriately credit the artist.
Deactivating the theme should not normally change or delete any of your settings for that theme.
Anyway, you might want to try another angle first: What other plugins are you using (especially any that have got something to do with “media”)? Try disabling them all (except Media Credit) and then look if the problem has gone away. If it has, re-enable them one by one until you find the one with an incompatibility. (There is a separate tab “Recently active” on the Plugins page, so you won’t lose track.)
First of all thx for the great plugin. But I have the same or a similar problem as siricar.
If I edit/add credits for an image in the media library everything works fine, also if I add a new image to a post. But if I try to update or add credits to an existing image of an editors post it didn’t work. It appears a loading icon in the input field and if I hit the update/save button an error shown up in the console.Console:
Uncaught TypeError: Cannot read property 'attr' of undefined media-credit-tinymce.js?wp-mce-4310-20160418:796
WordPress Version: 4.52 + 4.53
Theme: customized/proprietary theme.We are using multiple plugins, but the error seems not related to them. I disabled all but same problem.
Thanks for the report, now I think we are getting somewhere. Can you please walk me through the steps one by one?
Example:
- User 1 creates a post and uploads some images
- User 2 opens that post and clicks the Add Media button
- …
I know it’s tedious, but I have to replicate things as exactly as possible to find this bug.
Hi everybody,
Same problem here. The steps to problem are:
1. Access edit page of any post (ex. meusite.com/wp-admin/post.php?post=2296&action=edit)
2. Select an image already inserted on post content and click at pencil icon to edit image
3. Put some text (or modify an existent) on “Credit” field and click “Update”
4. The new credit text didn’t appear on image post content
5. Save post and view it… Nothing happens. The credit text wasn’t update.Help us please, @pepe! I tryed a lot of another solutions and nothing ??
(Sorry for English errors!)
OK, I get the scenario now. I’ll have a look at this in the next few days.
- The topic ‘Media credit doesn't display if no caption present’ is closed to new replies.