Closed bostondv closed 9 years ago
I also get the issue using [media]
Fatal error: Call to a member function setAttribute() on a non-object in /home/pomelo/webapps/dynamicgreens_dev/web/app/plugins/bootstrap-3-shortcodes/bootstrap-shortcodes.php on line 1575
WordPress 3.9.1 PHP 5.5.7 Apache
TinyMCE content:
[media]
[media-object pull="right"]
...
[/media-object]
[media-body title="Testing"]
Test
[/media-body]
[/media]
I think these are separate issues. Let's take them one at a time.
[table-wrap] Can you double-check the "Text" tab in your WordPress page or post? I got the same errors you saw when I copy-and-pasted your table, and it turns out to have pasted like this:
When I corrected the to be proper HTML rather than entities, it worked on my test site.
[media] The [media-object] shortcode actually expects an image as its contents. I can add some error-checking for this in a future version, but I'll bet if you stick an image that shortcode it'll work.
Let me now how these turn out and we'll keep troubleshooting if necessary!
I can open a separate issue for media object, if it's better?
[table-wrap]
That's odd about the entities, I think it may be due to the copy-paste from github because in the editor I have proper html markup.
[media]
I actually had an image there, just omitted it from my comments. With the following markup I still get an error.
[media]
[media-object pull="right"]
<img class="alignnone wp-image-804 size-full" src="http://dynamicgreens.pmlo.org/app/uploads/2014/06/alpha-linolenic-acid.png" alt="alpha-linolenic-acid" width="256" height="213" />
[/media-object]
[media-body title="Testing"]
Donec ullamcorper nulla non metus auctor fringilla.
[/media-body]
[/media]
Both I've now tested on a dev site with plugins disabled and using Twenty Eleven theme. Was able to reproduce the error for both shortcodes.
Thanks!
Hm. Both of those functions use PHP's DOMDocument class. I wonder if your host doesn't like that class somehow.
Does this shortcode also produce the error?
[img type="circle" responsive="true"]<img class="alignnone" src="http://upload.wikimedia.org/wikipedia/en/1/11/Serenityship.jpg" alt="" width="250" height="154" />[/img]
Also, just to be sure, does WordPress think the table markup is good? Your table (once the entities are fixed) is working correctly in my test environment and the WordPress visual editor looks like this:
The [img] shortcode worked and yes, the table is correct in the visual tab.
I think I've identified cause of the issues for both though. If there are new lines between the and the opening or closing [media-object] shortcodes, it fails. Same goes for
Using [table-wrap] I am getting the following errors when loading page in front end.
This is the code in TinyMCE editor:
Running plugin version 3.2.3