I'm attempting to upgrade a news aggregation site built using 4.7.x and aggregator2 that is long overdue. As a first step I have attempted to install the aggregation module, with a view to migrating all my feeds and feed items to aggregation, then begin work on upgrading the site to 5.x code.

Upon attempting to install, the import of the aggregator2 table content started well enough, but stopped part way through (i have over 300 feeds and around 77000 feed items), throwing up a series of errors of the form:

Type: php
Date: Wednesday, April 16, 2008 - 06:25
User: admin
Location: http://localhost:8888/example.com/en/admin/modules
Referrer: http://localhost:8888/example.com/en/admin/modules
Message: Illegal offset type in /Users/graham/Documents/webdocs/example.com/modules/contrib/aggregation/aggregation.install on line 262.
Severity error
Hostname ::1

The module appears to be installed but I can't see its settings page.
I'm doing all this on a copy of the site sitting on my Mac using MAMP, with php 5.2.3, mySQL 5.0.41 and Apache 2.0.59

I'm confident that I'm following the import procedure set out in the aggregation readme. Any advice as to where I might be going wrong would be gratefully received.

An alternative approach would be to try to upgrade to 5.x and then run the import using the 5.x version of aggregation, but I'd rather be clear that the aggregation module will import and install successfully before I get into that.

Thanks
Graham

Comments

Ashraf Amayreh’s picture

Assigned: Unassigned » Ashraf Amayreh
Category: support » bug
Status: Active » Closed (fixed)

Well, I don't know weather I recommend upgrading to 4.7.x or to 5.x directly... anyway, I'm no longer maintaining the 4.7.x release, the fix will be included in the 5.x branch on the next release. Nevertheless, here's the solution:

Locate this block of code in the aggregation.install file

        foreach ($taxonomies_old_style AS $key => $value)
        {
            $vid = db_fetch_object(db_query("SELECT vid FROM {term_data} WHERE tid = %d", $value))->vid;
            $taxonomies_new_style[$vid][$value] = $value;
        }

and replace it with

        foreach ($taxonomies_old_style AS $key => $value)
        {
            $vid = db_query("SELECT vid FROM {term_data} WHERE tid = %d", $value);
            if (db_num_rows($vid) == 0) continue;
            $vid = db_fetch_object($vid)->vid;
            $taxonomies_new_style[$vid][$value] = $value;
        }

Restore the DB, repeat the installation, then let me know what happens. Yours is a perfect test case for the upgrade scripts so your feedback is very welcome and appreciated.

tobedeleted’s picture

Status: Closed (fixed) » Active

Thanks for the modified code.

I made the edit as you set out, and reinstalled the module on a clean copy of the database. The two tables are created, as before, and some records appear to be successfully imported, as before : 71 records for the feed table and 48,500 or so for the feed item table. Last time I recall it reached 72 and a little over 50,000 respectively before the errors were reported. The database includes something over 300 feeds and about 73,000 feed items.

The same error then occurs:

Illegal offset type in example.com/sites/default/modules/aggregation/aggregation.install on line 263.

I'm pretty sure I followed the process as you laid it, out to the letter. I hope this is useful feedback. If you can suggest anything else I'd be really grateful.

Regards
Graham

tobedeleted’s picture

Version: 4.7.x-3.1 » 5.x-4.6

Making a second attempt at upgrading my 4.7 site. now working with 5.x-4.6 version of Aggregation, and have taken a different approach:

Upgrade site to 5.10, then try to install Aggregation and see if it migrates all my aggregator2 feeds and feed items.

Got a white screen on trying to install the module, and the log shows the following:

Column count doesn't match value count at row 1 query: aggregation_update_6 INSERT INTO aggregation_feed VALUES (890, 'Yahoo! News', 'http://uk.news.search.yahoo.com/news/rss?ei=UTF-8&va=&va_vt=any&vp=worke..., '', '', 60, 0, 'no', 'yes', 'no', 'no', 'no', 'no', 1 ,'no', 'yes', 'a:2:{i:4;a:1:{i:28;s:2:\"28\";}i:1;a:1:{i:2;s:1:\"2\";}}', '', 0, 1222377849) in /Users/graham/Documents/webdocs/icanews510/includes/database.mysql.inc on line 172.

followed by thousands of errors of the type:

Unknown column 'link_to_original_url' in 'field list' query: aggregation_update_6 INSERT INTO aggregation_item (nid, url, link_to_original_url, original_author, story_guid, fid, image_id, image_guid) VALUES (81815, 'http://www.redorbit.com/news/business/1347902/iea_chief_meets_uae_offici..., 'yes', 'unspecified', 4081639514, 2238, 0, 0) in/Users/graham/Documents/webdocs/icanews510/includes/database.mysql.inc on line 172.

Any advice most welcome.

Regards
Graham