mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #05423
[Bug 814119] Re: PHP Error when registering a new user and the default views have textbox blocks
Hi Matt,
If you would like, you can try out our review system with your updated
code. Have a look at
https://wiki.mahara.org/index.php/Developer_Area/Contributing_Code
I can help you out for any issues you have with git, gerrit or the whole
process.
Cheers,
Hugh
On 22/07/11 02:45, Matt Gibson wrote:
> Public bug reported:
>
> When registering a new user, the system duplicates the views that are
> marked as copynewuser = 1 in the views table. If one of these views has
> a textbox block, it causes an error as follows:
>
> [Thu Jul 21 15:02:58 2011] [error] [client 128.86.248.122] [WAR] 3c (blocktype/lib.php:1134) Invalid argument supplied for foreach()
> [Thu Jul 21 15:02:58 2011] [error] [client 128.86.248.122] Call stack (most recent first):
> [Thu Jul 21 15:02:58 2011] [error] [client 128.86.248.122] * log_message("Invalid argument supplied for foreach()", 8, true, true, "/var/www/epihrrt/docroot/blocktype/lib.php", 1134) at /var/www/epihrrt/docroot/lib/errors.php:444
>
> This is caused by the following code (line 1191 of blocktype/lib.php),
> which assumes that if $configdata['artefactids'] is not there, then
> $configdata['artefactids'] will be, which it isn't for this block type.
>
> // Record new artefact ids in the new block
> if (isset($configdata['artefactid'])) {
> $configdata['artefactid'] = $artefactcopies[$configdata['artefactid']]->newid;
> }
> else {
> foreach ($configdata['artefactids'] as &$oldid) {
> $oldid = $artefactcopies[$oldid]->newid;
> }
> }
>
>
> It needs to look like this:
>
> // Record new artefact ids in the new block
> if (isset($configdata['artefactid'])) {
> $configdata['artefactid'] = $artefactcopies[$configdata['artefactid']]->newid;
> }
> else if (isset($configdata['artefactids'])) {
> foreach ($configdata['artefactids'] as &$oldid) {
> $oldid = $artefactcopies[$oldid]->newid;
> }
> }
>
> Mahara 1.3.6, but the code is the same in 1.4
>
> ** Affects: mahara
> Importance: Undecided
> Status: New
>
--
Hugh Davenport
803 2258
Developer
Catalyst Ltd.
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
https://bugs.launchpad.net/bugs/814119
Title:
PHP Error when registering a new user and the default views have
textbox blocks
Status in Mahara ePortfolio:
New
Bug description:
When registering a new user, the system duplicates the views that are
marked as copynewuser = 1 in the views table. If one of these views
has a textbox block, it causes an error as follows:
[Thu Jul 21 15:02:58 2011] [error] [client 128.86.248.122] [WAR] 3c (blocktype/lib.php:1134) Invalid argument supplied for foreach()
[Thu Jul 21 15:02:58 2011] [error] [client 128.86.248.122] Call stack (most recent first):
[Thu Jul 21 15:02:58 2011] [error] [client 128.86.248.122] * log_message("Invalid argument supplied for foreach()", 8, true, true, "/var/www/epihrrt/docroot/blocktype/lib.php", 1134) at /var/www/epihrrt/docroot/lib/errors.php:444
This is caused by the following code (line 1191 of blocktype/lib.php),
which assumes that if $configdata['artefactids'] is not there, then
$configdata['artefactids'] will be, which it isn't for this block
type.
// Record new artefact ids in the new block
if (isset($configdata['artefactid'])) {
$configdata['artefactid'] = $artefactcopies[$configdata['artefactid']]->newid;
}
else {
foreach ($configdata['artefactids'] as &$oldid) {
$oldid = $artefactcopies[$oldid]->newid;
}
}
It needs to look like this:
// Record new artefact ids in the new block
if (isset($configdata['artefactid'])) {
$configdata['artefactid'] = $artefactcopies[$configdata['artefactid']]->newid;
}
else if (isset($configdata['artefactids'])) {
foreach ($configdata['artefactids'] as &$oldid) {
$oldid = $artefactcopies[$oldid]->newid;
}
}
Mahara 1.3.6, but the code is the same in 1.4
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/814119/+subscriptions
References