[jonah] No Data Within Jonah's Main Screen

Ben Scott bscott@chiark.greenend.org.uk
Fri Nov 29 16:54:51 2002


On Fri, 29 Nov 2002, Ibarra, Michael wrote:

> I get no data, just the usual icon. When I click on "options" I get the
> following error:
>
> Fatal error: Call to undefined function: liststations() in
> /apache/htdocs/horde/jonah/prefs.php on line 56
>
> I know my optins are set because I see data/headlines when I log in (from
> Horde's main screen), just
> not from Jonah itself. If it were a misconfig, wouldn't I also get no data
> from Horde?
>

I think things broke when my dodgy sql patch got merged in. Attached is a
cvs diff of my current work in progress - it sort of works, but has some
quirks, notably a one refresh lag between choosing a country and it
displaying the drop down list of locations for that country, but at least
it doesn't produce any errors (for me).

HTH,
Ben

-- 
Ben Scott                                Powered by C8H10N4O2
bscott@chiark.greenend.org.uk (personal)
ben.scott@enfocast.com (work)
-------------- next part --------------
Index: prefs.php
===================================================================
RCS file: /repository/jonah/prefs.php,v
retrieving revision 1.5
diff -r1.5 prefs.php
24,25c24,28
<     if (!empty($country)) {
<         $prefs->setValue('selectedcountry', $country);
---
> 
>     if ( isset($country) && $country != '' ) {
>         // strip out url...
>         $nicecountry = preg_replace( '/.*=/', '', $country);
>         $prefs->setValue('selectedcountry', $nicecountry);
57c60
< $selected_country = $prefs->getValue('selectedcountry');
---
> $selected_country = $prefs->getValue('selectedcountry'); 
64c67
<     $url = Horde::addParameter($url, 'selectedcounty=' . $country);
---
>     $url = Horde::addParameter($url, 'selectedcountry=' . $country);
Index: config/prefs.php.dist
===================================================================
RCS file: /repository/jonah/config/prefs.php.dist,v
retrieving revision 1.8
diff -r1.8 prefs.php.dist
140c140
<     'value' => 'none',
---
>     'value' => null,
Index: config/weather.php.dist
===================================================================
RCS file: /repository/jonah/config/weather.php.dist,v
retrieving revision 1.4
diff -r1.4 weather.php.dist
4c4
< $params = $conf['weather']['params'];
---
> $params = $conf['weather']['storage']['params'];
7c7
< if ($conf['weather']['driver'] == 'default') {
---
> if ($conf['weather']['storage']['driver'] == 'default') {
668,673d667
<     if (!array_key_exists('stationstable', $params)) {
<         $this->_params['stationstable'] = 'jonah_weatherstations';
<     }
<     if (!array_key_exists('countriestable', $params)) {
<         $this->_params['countriestable'] = 'jonah_weathercountries';
<     }    
685c679
<     $city = preg_replace ( '/' . $country . '/', '' , $location);
---
>     $city = preg_replace ( '~' . $country . '~', '' , $location);
691c685
<            'radar' => $db->getOne(sprintf('SELECT radar FROM %s WHERE 
---
>            'radar' => $db->getOne(sprintf('SELECT radar FROM jonah_weatherstations WHERE 
693d686
<                                   $params['stationstable'],
696c689
<             'url'  => $db->getOne(sprintf('SELECT url FROM %s WHERE 
---
>             'url'  => $db->getOne(sprintf('SELECT url FROM jonah_weatherstations WHERE 
698d690
<                                   $params['stationstable'],
Index: lib/api.php
===================================================================
RCS file: /repository/jonah/lib/api.php,v
retrieving revision 1.6
diff -r1.6 api.php
168c168
<     if (!array_key_exists($location, $weather) || !is_array($weather[$location])) {
---
>     if ( $location == null || !array_key_exists($location, $weather) || !is_array($weather[$location])) {
Index: lib/Weather/sql.php
===================================================================
RCS file: /repository/jonah/lib/Weather/sql.php,v
retrieving revision 1.2
diff -r1.2 sql.php
96,103c96,98
<             $stations = $this->_db->getAssoc(sprintf('SELECT * FROM jonah_weatherstations WHERE country="%s"',
<                                                      $this->_db->quote($selcountry)));
<             foreach ($stations as $station) {
<                 $this->_stations[$selcountry]['stations'][] = array();
<                     //'url' => $station['url'],
<                     //'name' => $station['name']);
<             }
<             return $this->_stations[$selcountry];
---
>             $stations = $this->_db->getAssoc(sprintf('SELECT name,name FROM jonah_weatherstations WHERE country="%s"',
>                                                      $selcountry));
>             return $stations;
Index: templates/prefs/setlocation.inc
===================================================================
RCS file: /repository/jonah/templates/prefs/setlocation.inc,v
retrieving revision 1.3
diff -r1.3 setlocation.inc
37c37
<    location = document.prefs.country.options[document.prefs.country.selectedIndex].value;
---
>     location = document.prefs.country.options[document.prefs.country.selectedIndex].value;


More information about the jonah mailing list