mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #53614
[Bug 1827390] Re: Latency smarty header_logo_small - IMPORTANT
*** This bug is a duplicate of bug 1827445 ***
https://bugs.launchpad.net/bugs/1827445
** This bug has been marked a duplicate of bug 1827445
Improve efficiency when checking if a table field exists
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1827390
Title:
Latency smarty header_logo_small - IMPORTANT
Status in Mahara:
In Progress
Bug description:
public function header_logo_small() {
if (!empty($this->headerlogosmall)) {
returnget_config('wwwroot') .'thumb.php?type=logobyid&id='.$this->headerlogosmall;
}
else {
require_once('ddl.php');
$table = newXMLDBTable('institution');
$field = newXMLDBField('logoxs');
if (field_exists($table, $field) && $sitelogosmallid = get_field('institution', 'logoxs', 'name', 'mahara')) {
returnget_config('wwwroot') .'thumb.php?type=logobyid&id='.$sitelogosmallid;
}
}
returnfalse;
}
In this function compare to header_logo, why using ddl.php and newXMLDBTable / Field. It's not ncessary and that's create many latency when i test with a profiler.
Rewrite this fucntion like header_logo just decrease calls on data base.
- Mahara 18.10
- MySqL 5.7
- Php 7.2
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1827390/+subscriptions
References