[solved] not able to display errors after failing module install

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

[solved] not able to display errors after failing module install

Post by Jos »

I don't seem to find a way to show an errormessage after module install fails.

Yesterday Calguy suggested me in IRC:

Code: Select all

return array(FALSE, $errmsg);
That does stop executing method.install.php, butt still results in a succesfully install message

To use

Code: Select all

echo $this->ShowErrors($errmsg);
results in an immediate redirect to the succesfully install message...

Somebody has an idea to display errors during module install?
Last edited by Jos on Sun Apr 18, 2010 5:27 pm, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: not able to display errors after failing module install

Post by Jos »

Can some module developer confirm if this code does or does not display an errormessage during the installationprocess of the module?

Code: Select all

return array(FALSE, 'install-error!');
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: not able to display errors after failing module install

Post by Jos »

Turns out to be a little bug...
it's a bug, I'll fix it in 1.7.1
but then in the method.install.php you will have to use a temporary variable to return an error
i.e:

Code: Select all

$tmp = 'This is an error message'; 
return $tmp;
Thx Calguy1000
User avatar
dc2
Forum Members
Forum Members
Posts: 116
Joined: Tue Jun 02, 2009 8:21 pm

Re: [solved] not able to display errors after failing module install

Post by dc2 »

I've the same problem here - I would like to abort installation if an error occurres (folder not writable) but if I use

Code: Select all

$tmp = $this->Lang('installerror');
return $tmp;
it refuses to work. Using this instead works:

Code: Select all

$tmp = 'An error occurred during installation';
return $tmp;
Using this before return also displays the correct message:

Code: Select all

die($this->Lang('installerror'));
Does anybody know how to fix this?

Edit: Additionaly I found a bug in the error-message-page - the url of "Back zu Menu" looks like this:
admin/{$thisurl}

(#5242: Bug-Tracker)
Last edited by dc2 on Sat Jul 31, 2010 5:02 pm, edited 1 time in total.
Post Reply

Return to “Developers Discussion”