-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Url convert to relative url #249
Comments
i can confirm this! Uncaught Error: TypeError: Cannot read property 'getContent' of null After Save: the URL from mediafiles is relative "../wp-content/..." if i toggle the main content area from text to visual, i get this error message: -Wordpress Version 4.6 br |
@simkea have you found out the solutions yet? |
Hello @simkea and @phungthien, can you update the file field_types/multiline_field/multiline_field.js with this version https://gist.github.com/hunk/63874b7cb35c552b5a900904aeb2cbc6 and check again. remember you need to add the URLs again 😞 because of the previous version store the relative URLs. |
Haha, it works!!! |
There is still this bug: here is my patch...
|
Hi @simkea, what is that bug? |
Uncaught Error: TypeError: Cannot read property 'getContent' of null if you have a custom-field (multiline) and the native post textarea -> |
Ah, I see it. |
Okay... this solution: https://gist.github.com/hunk/63874b7cb35c552b5a900904aeb2cbc6 |
Here is my Workaround to fix the error "relative urls" File: wp-content/plugins/magic-fields-2/admin/mf_tiny_mce.php Remove the 'wplink' in the array... this tinymce-plugin is not compatible with MF2 an the moment... in File: wp-content/plugins/magic-fields-2/admin/mf_custom_fields.php Line 185: |
Hi @phungthien, @simkea I think I got it, here is the ultimate fix 😂 https://gist.github.com/hunk/0e50800ce90f82f130c8d56ae05205f7 and I added the fix of @simkea for "Uncaught Error: TypeError: Cannot read property 'getContent' of null" @simkea with this fix you will not have the problem with native TinyMCE from WordPress, you can switch visual/HTML mode without a problem. Can you test this and tell me if it works? |
Yes it works! Great! i recommend to change the Code in follow file: in File: wp-content/plugins/magic-fields-2/admin/mf_custom_fields.php Line 185: And add a condition to check wordpress version - >then >= 4.6
like this -> /WordPress/wp-includes/class-wp-editor.php Good job! |
i recommend... `jQuery.mf_bind('add',function(){
} jQuery(".multiline_custom_field .add_editor_mf").each( function(index,value){ pls add the if conditions to check hasOwnProperty() ... :) thx |
I created this branch and I send almost all changes #251 @simkea two things: -about this line $this->options['option'][$k]['value'] = $v; I remember at beginning I have some errors when the options doesn't exist, but I don't remember well. I will make some test for see when this happened and change for a better way to handle this |
So currently it works with WordPress 4.6.x. Thank you so much! |
…line fix Url convert to relative url, Fixes #249
Hello,
I have issue when using multiline to edit content. The issue happens when I switch Wordpress default visual editor to Text mode (like image below)
and add text (include links and images) to MF multiline and hit Update. However, when I tried to see the html code in multiline, all urls were converted to relative urls - my domain name was changed to ../ (as image below)
This issue only happens when I edit content in multiline while the Wordpress default editor is in Text mode (not happen with Visual mode chosen).
Please help me if you have any ideas on this.
Thank you,
Thien Phung
The text was updated successfully, but these errors were encountered: