[dev] Re: "commit: jonah/lib News.php"/"commit: jonah/lib/News
sql.php"
Roger H}kansson
hson at ludd.luth.se
Thu Apr 24 15:25:16 PDT 2003
There are a cople of problems with these updates.
I don't have any news sources stored in my database yet, but I have 5 channels in my channels-site.php.
With this update the News doesn't work anymore for me.
>From my php_errors.log:
----
[24-Apr-2003 13:11:33] PHP Notice: Undefined variable: channels in /var/apache/htdocs/horde/jonah/lib/News/sql.php on line 264
[24-Apr-2003 13:11:33] PHP Fatal error: Unsupported operand types in /var/apache/htdocs/horde/jonah/lib/News.php on line 96
----
So I patched News/sql.php and News.php like this.
(I don't know if this is the best way to solve it but it works...)
----------------------------------------------------------------------------
*** /home/hson/dev/horde/jonah/lib/News.php Thu Apr 24 14:14:17 2003
--- News.php Thu Apr 24 14:05:41 2003
***************
*** 93,99 ****
}
$internal_channels = $this->getInternalChannels();
! return $base_channels + $internal_channels;
}
function getSubscribedChannels()
--- 93,103 ----
}
$internal_channels = $this->getInternalChannels();
! if(!is_a($internal_channels, 'PEAR_Error')) {
! return $base_channels + $internal_channels;
! } else {
! return $base_channels;
! }
}
function getSubscribedChannels()
----------------------------------------------------------------------------
----------------------------------------------------------------------------
*** /home/hson/dev/horde/jonah/lib/News/sql.php Thu Apr 24 14:14:18 2003
--- News/sql.php Thu Apr 24 14:03:54 2003
***************
*** 252,267 ****
function getInternalChannels()
{
$this->_connect();
$sql = 'SELECT source_id, source_name FROM jonah_sources ORDER BY source_name';
$results = $this->_db->getAll($sql, DB_FETCHMODE_ASSOC);
! foreach ($results as $channel) {
! $channels[$channel['source_id']]['name'] = $channel['source_name'];
! $channels[$channel['source_id']]['type'] = JONAH_INTERNAL_CHANNEL;
}
!
! return $channels;
}
function getSources()
--- 252,275 ----
function getInternalChannels()
{
+ $channels = array();
+
$this->_connect();
$sql = 'SELECT source_id, source_name FROM jonah_sources ORDER BY source_name';
$results = $this->_db->getAll($sql, DB_FETCHMODE_ASSOC);
! if (is_a($results, 'PEAR_Error')) {
! return $results;
}
! if(count($results) > 0 ) {
! foreach ($results as $channel) {
! $channels[$channel['source_id']]['name'] = $channel['source_name'];
! $channels[$channel['source_id']]['type'] = JONAH_INTERNAL_CHANNEL;
! }
! return $channels;
! } else {
! return PEAR::raiseError('No internal channels found');
! }
}
function getSources()
----------------------------------------------------------------------------
After applying them I get some other errors in php_error.log, but I don't know
if its due to some Horde-problems or if its jonah-related.
(And since I get my News I don't really care...)
------
[24-Apr-2003 14:07:55] PHP Notice: Undefined index: realm in /var/apache/htdocs/horde/lib/Auth.php on line 277
[24-Apr-2003 14:07:55] PHP Notice: unserialize() failed at offset 0 of 220 bytes in /var/apache/htdocs/horde/lib/Serialize.php on line 313
[24-Apr-2003 14:07:55] PHP Notice: unserialize() failed at offset 0 of 220 bytes in /var/apache/htdocs/horde/lib/Serialize.php on line 313
[24-Apr-2003 14:07:55] PHP Notice: Undefined index: realm in /var/apache/htdocs/horde/lib/Auth.php on line 277
------
--
Roger Håkansson
More information about the dev
mailing list