]> git.mxchange.org Git - friendica.git/commitdiff
Improved position of "close"
authorMichael <heluecht@pirati.ca>
Tue, 15 Aug 2017 10:10:09 +0000 (10:10 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 15 Aug 2017 10:10:09 +0000 (10:10 +0000)
include/contact_widgets.php
src/Core/PConfig.php

index 744d2f2b034e0fb00fb0e2051cc34c090c4f61e4..2bc1e89f5ccc0dc45fbe539412b562356173b7a5 100644 (file)
@@ -3,6 +3,8 @@
 use Friendica\App;
 use Friendica\Core\Config;
 
+require_once 'include/contact_selectors.php';
+
 function follow_widget($value = "") {
 
        return replace_macros(get_markup_template('follow.tpl'), array(
@@ -113,16 +115,13 @@ function networks_widget($baseurl, $selected = '') {
        );
 
        $nets = array();
-       if (dbm::is_result($r)) {
-               require_once 'include/contact_selectors.php';
-               while ($rr = dba::fetch($r)) {
-                       /// @TODO If 'network' is not there, this triggers an E_NOTICE
-                       if ($rr['network']) {
-                               $nets[] = array('ref' => $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
-                       }
+       while ($rr = dba::fetch($r)) {
+               /// @TODO If 'network' is not there, this triggers an E_NOTICE
+               if ($rr['network']) {
+                       $nets[] = array('ref' => $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
                }
-               dba::close($r);
        }
+       dba::close($r);
 
        if (count($nets) < 2) {
                return '';
index 5e1724324192134904b8b398d87c75395d31a94b..1c648882473eeec97b057ad12b57de94be4109eb 100644 (file)
@@ -43,11 +43,11 @@ class PConfig {
                                $a->config[$uid][$family][$k] = $rr['v'];
                                self::$in_db[$uid][$family][$k] = true;
                        }
-                       dba::close($r);
                } else if ($family != 'config') {
                        // Negative caching
                        $a->config[$uid][$family] = "!<unset>!";
                }
+               dba::close($r);
        }
 
        /**