Title: javascript error when using Classic mode and post containing credit
Last modified: October 31, 2019

---

# javascript error when using Classic mode and post containing credit

 *  Resolved [invisibleira](https://wordpress.org/support/users/invisibleira/)
 * (@invisibleira)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/)
 * Hi,
    This plugin has been really useful, and it’s functioning well for us in 
   Gutenberg, except when we go into an old post that has an image that’s been given
   a credit, and is being edited in classic mode under Gutenberg. In that situation,
   the post cannot be re-saved/saved after editing, and there is a javascript console
   error: media-credit-tinymce.min.js?wp-mce-4940-20190515:3 Uncaught (in promise)
   TypeError: t.breplace is not a function at media-credit-tinymce.min.js?wp-mce-
   4940-20190515:3 at RegExp.[Symbol.replace] (<anonymous>) at String.replace (<
   anonymous>) at o (media-credit-tinymce.min.js?wp-mce-4940-20190515:3) at zw.A.
   wpGetImgCaption (media-credit-tinymce.min.js?wp-mce-4940-20190515:3) at zw.<anonymous
   > (media-credit-tinymce.min.js?wp-mce-4940-20190515:3) at dp.c.fire (tinymce.
   min.js?ver=4940-20190515:2) at zw.fire (tinymce.min.js?ver=4940-20190515:2) at
   vp (tinymce.min.js?ver=4940-20190515:2) at sy (tinymce.min.js?ver=4940-20190515:
   2)
 * I’ve disabled all other plugins, and still experience the error if Media Credit
   is enabled (but not if it’s disabled). Any help or thoughts in fixing much appreciated!
   
   Thanks

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/#post-12088209)
 * Thanks for the report, I’ll look into it. I can’t promise a quick fix because
   I’ll probably have to code a proper upgrade routine from shortcodes to blocks,
   but I will try at least find a workaround for the time being.
 *  Thread Starter [invisibleira](https://wordpress.org/support/users/invisibleira/)
 * (@invisibleira)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/#post-12096570)
 * Pepe,
    Thank you–much appreciated! Regards, Ira
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/#post-12315117)
 * Hi [@invisibleira](https://wordpress.org/support/users/invisibleira/), sorry 
   for the long delay. Can you verify that the bug still occurs with WordPress 5.3?
   If so, please give some additional information about your browser and a step 
   by step guide to triggering the issue. I have not been able to trigger it in 
   my stripped-down development environment.
 * Here’s what I tried:
    - Enable Media Credit and Classic Editor plugins
    - Create a post containing an image with a credit
    - Disable Classic Editor plugin
    - Edit the previously created post and add some text to the Classic block
    - Save the new post
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/#post-12403293)
 * Hi [@invisibleira](https://wordpress.org/support/users/invisibleira/), can you
   help me tracing this?
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/#post-12654892)
 * Hi [@invisibleira](https://wordpress.org/support/users/invisibleira/), I think
   I found the bug (it’s a typo in a code path that is only relevant if the Classic
   Editor markup is broken).
 * Will be fixed in 4.1.0.
    -  This reply was modified 6 years, 2 months ago by [pepe](https://wordpress.org/support/users/pputzer/).
    -  This reply was modified 6 years, 2 months ago by [pepe](https://wordpress.org/support/users/pputzer/).
      Reason: Found bug!
 *  Plugin Author [pepe](https://wordpress.org/support/users/pputzer/)
 * (@pputzer)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/#post-12661172)
 * [Fixed in 4.1.0](https://github.com/mundschenk-at/media-credit/commit/a90cb8e26145bb0f172389b5fc25e60c585e9240).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘javascript error when using Classic mode and post containing credit’ 
is closed to new replies.

 * ![](https://ps.w.org/media-credit/assets/icon.svg?rev=2570388)
 * [Media Credit](https://wordpress.org/plugins/media-credit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/media-credit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/media-credit/)
 * [Active Topics](https://wordpress.org/support/plugin/media-credit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-credit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-credit/reviews/)

 * 6 replies
 * 1 participant
 * Last reply from: [pepe](https://wordpress.org/support/users/pputzer/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-when-using-classic-mode-and-post-containing-credit/#post-12661172)
 * Status: resolved