@ajnyga
Ok, this is what I got:
(mysql): SELECT * FROM user_settings WHERE user_id = '23'
-----<hr>
31350
31350
0
PHP Warning: assert(): Assertion failed in /var/www/ojs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 352
PHP Fatal error: Call to a member function getFilePath() on null in /var/www/ojs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 374
-----<hr>
Since I have added the below debug:
// Make sure that the implementation of the updated file │·······························································································································
// is compatible with its genre. │·······························································································································
error_log(print_r($updatedFile->getFileId(), true)); │·······························································································································
$updatedFile = $this->_castToGenre($updatedFile); │·······························································································································
│·······························································································································
// Complete the identifying data of the previous file if not given. │·······························································································································
$previousFileId = (int)($previousFileId ? $previousFileId : $updatedFile->getFileId()); │·······························································································································
$previousRevision = (int)($previousRevision ? $previousRevision : $updatedFile->getRevision()); │·······························································································································
│·······························································································································
// Retrieve the previous file. │·······························································································································
error_log(print_r($previousFileId, true)); │·······························································································································
error_log(print_r($previousRevision, true)); │·······························································································································
$previousFile = $this->getRevision($previousFileId, $previousRevision); │·······························································································································
assert(is_a($previousFile, 'SubmissionFile'));
The codes should the getFileID and somehow the previousFileID and the previousRevision
31350
31350
0
In this case:
mysql> select * from article_files where file_id = 31350;
+---------+----------+----------------+-----------------+------------+------------------------+-----------------+-----------+------------------------+------------+----------+---------------------+---------------------+-------+----------+
| file_id | revision | source_file_id | source_revision | article_id | file_name | file_type | file_size | original_file_name | file_stage | viewable | date_uploaded | date_modified | round | assoc_id |
+---------+----------+----------------+-----------------+------------+------------------------+-----------------+-----------+------------------------+------------+----------+---------------------+---------------------+-------+----------+
| 31350 | 0 | NULL | NULL | 31350 | 31350-35163-10-PB.html | application/pdf | 324352 | 31350-35163-10-PB.html | 7 | NULL | 2010-03-06 04:28:12 | 2010-03-06 04:28:12 | 1 | NULL |
| 31350 | 1 | 31349 | NULL | 30338 | 30338-31350-1-RV.pdf | application/pdf | 18501 | 30338-31349-1-SM.pdf | 2 | NULL | 2009-04-06 15:36:20 | 2009-04-06 15:36:20 | 1 | NULL |
+---------+----------+----------------+-----------------+------------+------------------------+-----------------+-----------+------------------------+------------+----------+---------------------+---------------------+-------+----------+
2 rows in set (0.01 sec)
I’m not sure about those results, but is this because file_id is not unique? Also, file_id has same article_id on the first, but not on the second(also file name is weird)?
Also, here are all non unique file_id - Not sure if this is a problem
mysql> select file_id, COUNT(*) from article_files GROUP BY file_id HAVING count(*) > 1;
+---------+----------+
| file_id | COUNT(*) |
+---------+----------+
| 31350 | 2 |
| 31898 | 2 |
| 31904 | 2 |
| 32051 | 3 |
| 32572 | 2 |
| 32573 | 4 |
| 37000 | 2 |
| 37265 | 2 |
| 37457 | 2 |
| 37458 | 3 |
| 39933 | 2 |
| 42195 | 2 |
| 44576 | 2 |
| 44854 | 4 |
| 44867 | 3 |
| 44868 | 3 |
| 44871 | 3 |
| 44890 | 3 |
| 44895 | 3 |
| 44897 | 3 |
| 44899 | 3 |
| 44901 | 3 |
| 44909 | 3 |
| 44919 | 3 |
| 44929 | 2 |
| 44977 | 3 |
| 44978 | 2 |
| 44979 | 2 |
| 44980 | 2 |
| 44981 | 2 |
| 44982 | 2 |
| 44991 | 2 |
| 45075 | 4 |
| 45079 | 3 |
| 45087 | 3 |
| 45119 | 3 |
| 45131 | 2 |
| 45143 | 2 |
| 45145 | 2 |
| 45155 | 2 |
| 45163 | 2 |
| 45166 | 2 |
| 45169 | 2 |
| 45175 | 3 |
| 45179 | 3 |
| 45183 | 3 |
| 45194 | 2 |
| 45256 | 2 |
| 45258 | 2 |
| 45259 | 2 |
| 45263 | 2 |
| 45282 | 3 |
| 45294 | 2 |
| 45298 | 2 |
| 45301 | 2 |
| 45358 | 2 |
| 45359 | 2 |
| 45365 | 2 |
| 45388 | 2 |
| 45389 | 2 |
| 45403 | 2 |
| 45413 | 2 |
| 45415 | 2 |
| 45436 | 2 |
| 45578 | 3 |
| 45611 | 2 |
| 45624 | 2 |
| 45625 | 2 |
| 45645 | 2 |
| 45650 | 2 |
| 45677 | 3 |
| 45678 | 2 |
| 45685 | 2 |
| 45796 | 2 |
| 45801 | 2 |
| 45857 | 2 |
| 45867 | 2 |
| 45869 | 2 |
| 45871 | 2 |
| 45875 | 2 |
| 45913 | 2 |
| 45919 | 2 |
| 45955 | 2 |
| 45956 | 2 |
| 45959 | 2 |
| 45998 | 2 |
| 46000 | 2 |
| 46006 | 2 |
| 46016 | 3 |
| 46027 | 2 |
| 46028 | 3 |
| 46034 | 2 |
| 46138 | 2 |
| 46144 | 2 |
| 46155 | 2 |
| 46182 | 6 |
| 46199 | 2 |
| 46248 | 4 |
| 46252 | 2 |
| 46253 | 2 |
| 46335 | 2 |
+---------+----------+
And I have some pretty high numbers in the file_id column as well…
| 46437 | 1 |
| 313500000 | 1 |
| 341230000 | 1 |
| 342900000 | 1 |
| 3135031354 | 1 |
| 3135031358 | 1 |
| 3135031359 | 1 |
| 3135031360 | 1 |
| 3135031361 | 1 |
| 3135031362 | 1 |
| 3135031363 | 1 |
+------------+----------+
Last edit:
Also: see how 3150 is the smallest non-duplicated file_id ? This probably means something right? Too unusal that it would error out exactly on the smallest numeber (if it goes sequencially)