Merge remote-tracking branch 'upstream/develop' into 1701-performance

This commit is contained in:
Michael 2017-03-07 21:24:20 +00:00
commit f7f23038db
6 changed files with 159 additions and 20 deletions

View file

@ -622,7 +622,7 @@ function poco_last_updated($profile, $force = false) {
$last_updated = "0000-00-00 00:00:00";
q("UPDATE `gcontact` SET `updated` = '%s', `last_contact` = '%s' WHERE `nurl` = '%s'",
dbesc($last_updated), dbesc(datetime_convert()), dbesc(normalise_link($profile)));
dbesc(dbm::date($last_updated)), dbesc(dbm::date()), dbesc(normalise_link($profile)));
if (($gcontacts[0]["generation"] == 0))
q("UPDATE `gcontact` SET `generation` = 9 WHERE `nurl` = '%s'",
@ -1611,6 +1611,11 @@ function get_gcontact_id($contact) {
*/
function update_gcontact($contact) {
// Check for invalid "contact-type" value
if (isset($contact['contact-type']) AND (intval($contact['contact-type']) < 0)) {
$contact['contact-type'] = 0;
}
/// @todo update contact table as well
$gcontact_id = get_gcontact_id($contact);