RWML-Error on TotalCMS blog post page

Hi there,

I set-up a page with RWML and TotalCMS which works fine except one thing:
The page that shows the single blog posts displays a notice:

**Notice** : Undefined variable: parameterValue in **/var/www/vhosts/** on line **238**

where the line 238 of index.php belongs to this function:

232		// If the language query string does not match a configured language, fallback to the default   language (stops no content being shown)
233		if(empty($_GET)) {
234    	// No variables are specified in the URL
235		} else {
236			// Variables are present
237	    $userConfiguredLanguages = array("de", "en", "", "", "", "", "", "", "", "");
238	    if (in_array($parameterValue, $userConfiguredLanguages)) {
239	      // Language exists in RWML, so do nothing
240	    } else {
241	      // Language does not exist, fallback to the default language
242	      $this->_configuration->setProperty("languageActive", $this->_configuration->getProperty("languageDefault"));
243	    }
244		}

All other pages including the blog list are working fine. So what’s wrong with the single post page?
All pages have the same RWML and CMS settings as partials.

Link to the website (single blog post)

Looks like a PHP notice, not a RWML error.

There are big differences between PHP errors and notices. Notices are simple informational outputs to report things to the website developer; whereas errors are displayed when something physically breaks and something cannot complete.

What happens when you ask your website hosting company to take the website out of development mode, so that the PHP reporting is set to errors only? That’s what it should be set to already.

Looks like you have PHP reporting set far too high and its outputting everything. That would be the first thing to check and resolve.

1 Like

Hi Will,
you are right, I forgot to change the topic to “notice” as I did in the body text after pasting in the code.

I will also contact my hosting company to only report errors.

But nevertheless, if the variable parameterValue would not be undefined, the notice would not be necessary.
So maybe there is a backup option - in case my hosting provider will not change PHP settings - if we could figure out why the variable is not defined on this type of pages.
How about tweaking the post url and append a language parameter? Or define and set the parameter manually via page options?

I have zero experience or interest with TotalCMS. So no idea what would be involved in changing post URLs or appending parameters. Sorry. Probably best for someone else to answer that one for you.

Can’t really speculate what the notice is, without having SFTP access to the website and running more detailed diagnostics. There are an infinite number of factors at play.

Some care is needed if you start to do things dynamically - either creating new pages dynamically or appending things onto the ends of URLs. Depending on the setup, there are times when RWML and other stacks may not be able to see these new things getting generated or changed.

We typically develop stacks on the underlying principle that the webpages you are making are ‘static’ and have a physical presence on the hosting web server. Because traditionally RapidWeaver is a static website generator. In other words, they are webpages you can actually see when you login via FTP or your CPanel file manager.

Have a look at this FAQ…

That PHP notice is saying that $parameterValue is being used without it ever being defined. That is a part of RWML code so I cannot speak to that. However, my FAQ above will at least help you suppress notices be printed to the browser.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.