We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 8403 - logs contain errors on every request: "Undefined index: remote_url"
logs contain errors on every request: "Undefined index: remote_url"
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: Open Journal Systems
2.4.3
PC Linux
: P3 normal
Assigned To: PKP Support
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-22 10:36 PDT by Charles Parker
Modified: 2013-09-05 17:09 PDT (History)
1 user (show)

See Also:
Version Reported In:
Also Affects:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Parker 2013-08-22 10:36:37 PDT
After upgrading from OJS 2.3.6 to 2.4.2, I have the following errors in my Apache log on every request (sometimes up to a dozen of these on a single request):

[Thu Aug 22 17:06:05 2013] [error] [client 1.2.3.4] NOTICE: Undefined index: remote_url (/var/www/ojs/classes/article/ArticleGalleyDAO.inc.php:284), referer: http://my.site.org/index.php/code/article/view/1/2

This is a default install on CentOS, with the addition of XML Galleys plugin.

Looking at line 284:
$galley->setRemoteURL($row['remote_url']);

And then in my database (below), I see why this error is being generated (remote_url is NULL). However, I don't know if there should be data in this column, or (more likely) a NULL check needs to be added to the above line of code.

In my installation, I added the following test to eliminate the errors:

                if (isset($row['remote_url'])) {
                        $galley->setRemoteURL($row['remote_url']);
                }

mysql> SELECT * FROM article_galleys;
+-----------+--------+------------+---------+-------+-------------+---------------+-----+-------+------------+
| galley_id | locale | article_id | file_id | label | html_galley | style_file_id | seq | views | remote_url |
+-----------+--------+------------+---------+-------+-------------+---------------+-----+-------+------------+
|         1 | en_US  |          2 |       7 | XML   |           1 |             8 |   0 |     0 | NULL       |
|         2 | en_US  |          1 |      12 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|         3 | en_US  |         12 |      36 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|         4 | en_US  |          3 |      37 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|         5 | en_US  |          4 |      38 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|         6 | en_US  |          5 |      39 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|         7 | en_US  |          6 |      41 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|         8 | en_US  |          7 |      42 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|         9 | en_US  |          8 |      43 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|        10 | en_US  |          9 |      44 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
|        11 | en_US  |         10 |      45 | HTML  |           1 |          NULL |   0 |     0 | NULL       |
+-----------+--------+------------+---------+-------+-------------+---------------+-----+-------+------------+
11 rows in set (0.00 sec)
Comment 1 Alec Smecher 2013-09-05 17:09:01 PDT
Charles, see the attached patch as an alternative solution.
Comment 2 Alec Smecher 2013-09-05 17:09:01 PDT
Fixed missing column fetch
https://github.com/pkp/ojs/commit/625f186f9dd8fc1d42e78944d2583e0e6eea2ae1