Theme error

Theme error

autor sanjeev meston -
Počet odpovědí: 9

Every them that I try to add as a plugin installs, but I get this message on each page.

How do I get rid of this, My Moodle version is 2.7

Notice: Undefined variable: output in/home/silvor5/public_html/meston.net.au/moodle/theme/mestonnew/renderers.phpon line 103

Notice: Undefined variable: output in/home/silvor5/public_html/meston.net.au/moodle/theme/mestonnew/renderers.phpon line 101

http://meston.net.au/moodle/

Průměr hodnocení: -
V odpovědi na sanjeev meston

Re: Theme error

autor Mary Evans -

You have not declared the variable for $output

Yes you have added $output = etc.,

but you also added a concatenation . point, which in this case it does not need, so try taking out that 'dot' before the equal sign like so...

$output = html_writer::tag('div', html_writer::tag('div', $actionhtml. $title . $controlshtml, array('class' => 'title')), array('class' => ' title'));

V odpovědi na Mary Evans

Re: Theme error

autor sanjeev meston -

Hi Mary, Thank you, very much, that solved one of the error notifications. However, I still see this notification.

Notice: Undefined variable: output in/home/silvor5/public_html/meston.net.au/moodle/theme/mestonnew/renderers.phpon line 103

I am not into php scripting / coding, so will appreciate some more assistance

V odpovědi na sanjeev meston

Re: Theme error

autor Gareth J Barnard -
Obrázek: Core developers Obrázek: Particularly helpful Moodlers Obrázek: Plugin developers
Hi Sanjeev,


Given '/theme/mestonnew/' it appears that you are creating your own theme and yet you state "I am not into php scripting / coding, so will appreciate some more assistance" therefore I recommend you select one of the following courses of action:

Kind regards,

Gareth

V odpovědi na Gareth J Barnard

Re: Theme error

autor sanjeev meston -

the theme is generated by Artisteer

V odpovědi na sanjeev meston

Re: Theme error

autor Richard Oelmann -
Obrázek: Core developers Obrázek: Plugin developers Obrázek: Testers

Having taken out the . as Mary suggests, you have

        if ($title || $controlshtml) {
            $output = html_writer::tag('div', html_writer::tag('div', $actionhtml. $title . $controlshtml, array('class' => 'title')), array('class' => ' title'));
        }
        return $output;

But you have nothing to set $output if the condition is not met, so somewhere before that you need to set $output= something.


V odpovědi na sanjeev meston

Re: Theme error

autor Mary Evans -

If you look at moodle/lib/outputrrenderer.php and look for that Ffunction that is causing all the problem you will find some code there that is missing from your theme renderer.

https://github.com/moodle/moodle/blob/MOODLE_27_STABLE/lib/outputrenderers.php#L1300

V odpovědi na Mary Evans

Re: Theme error

autor sanjeev meston -

Thanks Mary and Richard, 

I sincerely appreciate all your help.