Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hello,

    I’m not sure why this would happen.
    Can you please provide information about your environment?
    Also, if you could test with no other plugins active and just using the twentyseventeen theme, that would be great.
    I’m going to need more info to even start to troubleshoot this.

    I had the same problem when using uploaded files on an external server.

    To fix it I made the following addition to functions/attachment-modal.php (line 13-19 shown below):

      $svg_path = get_attached_file( $attachment->ID );
      if ( ! file_exists( $svg_path ) ) {
        // In the case where the SVG is located on an external URL
        // (not on this server), we use the URL instead of the path
        $svg_path = $response[ 'url' ];
      }
      $dimensions = bodhi_svgs_get_dimensions( $svg_path );
    

    Highlighted diff: https://gist.github.com/malthejorgensen/4ec565f444c969731c71089afd70cbde/revisions

    Plugin Author Benbodhi

    (@benbodhi)

    Hi @malthejorgensen,

    Thanks so much for looking into this and finding out the issue, and ultimately providing your fix!

    I’ve just got out of hospital after surgery so haven’t had a chance to look into it much.

    I’ll make an effort to run some tests with this and hopefully all is good and will be in the next release.

    Cheers
    Ben

    One more thing – I think the basic idea of the change I made is correct, however it’s unclear to me whether to use $response['url'] or one of the attributes on the $attachment-object — e.g. get_attachment_link( $attachment->ID ) (I don’t know a lot about WordPress internals).

    (Note to self: https://wpseek.com/function/wp_prepare_attachment_for_js/ – the filter is called from here, so here almost all the $attachment-attributes are listed)

    P.S. Hope everything went well with the surgery, and that you’re feeling OK ??

    Plugin Author Benbodhi

    (@benbodhi)

    Hi @same_ivan & @malthejorgensen,

    Thanks for your patience with this.
    I have added the suggested code to version 2.3.7, thank you kindly for providing this.

    Everything went great with surgery, still not walking yet (I had leg/knee surgery after a huge snowboarding accident), but will be stronger than ever once I’m up on my feet again.

    I will mark this as resolved, but please do let me know if this issue persists for you.

    Cheers
    Ben

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘500 Internal Server Error’ is closed to new replies.