• Hi

    Using the latest version of CoursePress and the theme it comes with on WP4.0 (Australian English)

    I see
    Warning: DOMDocument::loadHTML(): Empty string supplied as input in /Users/stevep/Documents/overseas/isv/wordpress/wordpress 2/wp-content/plugins/coursepress/themes/coursepress/content-course-overview.php on line 105
    in the right hand widget panel.

    Possibly related: the course outline does not display under the Course Structure heading.

    https://wordpress.org/plugins/coursepress/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @pavarnos,

    Sorry to hear of the problem you are having.

    This is a simple PHP warning and most of the time it doesn’t affect any functionality so it is nothing to worry about!

    Do you have WP_DEBUG set to true in your wp-config.php file?

    If you do then please set it to false.
    This will hide the warning messages and you will be able to use your site normally.

    Could you please share me the screenshot of warning message that you are getting or page link where it is displaying so that i can troubleshoot it?

    For screenshots, you can simply provide a link to an image through Google Drive, Dropbox, screencast.com, http://imgur.com/ or other image service. 🙂

    Kind Regards,
    WPMU DEV

    Thread Starter pavarnos

    (@pavarnos)

    Hi

    See my other bug report: WP_DEBUG is on, E_ALL | E_STRICT for error reporting.

    Screenshot images as requested.

    http://imgur.com/bJwsFfk and http://imgur.com/PcgDCUb

    thanks very much for your help

    Thread Starter pavarnos

    (@pavarnos)

    PS did you notice the other bug? The course outline is not displaying under the course heading. Your intro video on your side shows that the structure of the course (units and pages) will be displayed under the “Course Outline” title on the detail page.

    thanks

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @pavarnos,

    Thank you for sharing the screenshot.

    I could reproduce this warning message on my test site by disabling avatar from Discussion Settings therefore i have notified the plugin developer to fix it.

    In the meanwhile to resolve this warning message could you please try editing the following code on line number 96 in the coursepress theme file content-course-overview.php

    Before Editing :

    <div id="instructor-profiles">
        <?php
        foreach ( $instructors as $instructor ) {
            ?>
    
            <h3><?php echo $instructor->display_name; ?></h3>
    
            <?php
            $doc = new DOMDocument();
            $doc->loadHTML(get_avatar($instructor->ID, 235));
            $imageTags = $doc->getElementsByTagName('img');
    
            foreach ( $imageTags as $tag ) {
                $avatar_url = $tag->getAttribute('src');
            }
            ?>
    
            <div>
                <img src="<?php echo $avatar_url; ?>" />
                <p>
                    <?php echo author_description_excerpt($instructor->ID, 50); ?>
                </p>
                <a href="<?php echo do_shortcode('[instructor_profile_url instructor_id="' . $instructor->ID . '"]'); ?>" class="full-instructor-profile"><?php _e('View Full Profile'); ?></a>
            </div>
        <?php } ?>
    </div>


    After Editing :

    <div id="instructor-profiles">
        <?php
        foreach ( $instructors as $instructor ) {
            ?>
    
            <h3><?php echo $instructor->display_name; ?></h3>
            <div>
            <?php
            $doc = new DOMDocument();
            if( get_avatar($instructor->ID, 235) != '' ){
            $doc->loadHTML(get_avatar($instructor->ID, 235));
            $imageTags = $doc->getElementsByTagName('img');
    
            foreach ( $imageTags as $tag ) {
                $avatar_url = $tag->getAttribute('src');
            }?>
            <img src="<?php echo $avatar_url; ?>" />
            <?php }else{
                echo "<p>Profile avatar is not set.</p>";
            }
            ?>
                <p>
                    <?php echo author_description_excerpt($instructor->ID, 50); ?>
                </p>
                <a href="<?php echo do_shortcode('[instructor_profile_url instructor_id="' . $instructor->ID . '"]'); ?>" class="full-instructor-profile"><?php _e('View Full Profile'); ?></a>
            </div>
        <?php } ?>
    </div>

    Best Regards,
    WPMU DEV

    Plugin Support Predrag – WPMU DEV Support

    (@wpmudev-support1)

    Hi @pavarnos,

    PS did you notice the other bug? The course outline is not displaying under the course heading. Your intro video on your side shows that the structure of the course (units and pages) will be displayed under the “Course Outline” title on the detail page.

    Could you please also share us the screenshot of this issue and tell us exactly which video you are referring so that we can test it?

    Regards,
    WPMU DEV

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

The topic ‘PHP error in content-course-overview.php’ is closed to new replies.