Easy-digital-downloads: Fatal error when using [downloads] shortcode

Created on 10 Oct 2017  路  5Comments  路  Source: easydigitaldownloads/easy-digital-downloads

I did something really dumb and caused a fatal error. As silly as it was, it should probably fail silently.

I placed the [downloads] shortcode on a single download page...

PHP Fatal error:  Maximum function nesting level of '256' reached, aborting! in /wp-includes/cache.php on line 724
component-shortcodes scope-ui type-bug

Most helpful comment

Attached a PR. I think having [downloads] inside a single download isn't that silly and can be used to easily create related products, upsells, etc. The PR allows this.

Marked @since 3.0 but can update to something after that since there are template changes that need some testing.

All 5 comments

Attached a PR. I think having [downloads] inside a single download isn't that silly and can be used to easily create related products, upsells, etc. The PR allows this.

Marked @since 3.0 but can update to something after that since there are template changes that need some testing.

This appears to be working very well for me. Nice. Tested in Themedd, Vendd, and Twenty Eleven. It's being handled consistently in all of those themes. I can't find an issue. :+1:

Let's make this a 3.0 thing. Since it's a template section and has been around for quite a while, i do'nt see the need to rush to get it out.

Ok I fixed the merge conflicts with 3.0, but I'm having a few reservations on this one. Previously we checked for an except, and if it was there we fell back to trimming the post content. Some reservations I have:

  • wp_trim_except() looks to only use post_content, not post_except
  • Our previous excerpts were limited to 30 characters, but wp_trim_except falls back to 55

Since this would alter the amount of content being displayed it could cause some display issues, and also seems like if someone supplies an except it won't be used here.

On release/3.0
image

On issue/6072
image

This is looking much better @spencerfinnell thanks.

Was this page helpful?
0 / 5 - 0 ratings