Menu

New warning with svn r973

Joachim
2013-05-01
2013-05-05
  • Joachim

    Joachim - 2013-05-01

    Hi Mark,

    just to let you know: with svn r973 after creating a new resource with svn r973, there is a PHP warning I never met before:

    Warning: array_search() expects parameter 2 to be array, string given in /var/www/wikindx4/core/modules/resource/RESOURCEVIEW.php on line 525

    Warning: array_search() expects parameter 2 to be array, string given in /var/www/wikindx4/core/modules/resource/RESOURCEVIEW.php on line 478

    Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www/wikindx4/core/modules/resource/RESOURCEVIEW.php on line 499

    Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www/wikindx4/core/modules/resource/RESOURCEVIEW.php on line 501

    The resource was added successful though.

    Regards
    Joachim

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-01

    Hi Joachim,

    I made some changes to the code in that area to speed up the processing of the next/previous links when viewing a single resource. Can you try the latest SVN please and let me know if it is fixed?

    Mark

     
  • Joachim

    Joachim - 2013-05-01

    SVN r974:

    A click on one of the "Recent additions or edits" resources results in an SQL error:

    Unable to read database.

    SELECT MAX(accessRatio) AS max FROM (SELECT ROUND(resourcemiscAccesses / DATEDIFF(CURDATE(), resourcetimestampTimestampAdd), 3) AS accessRatio FROM WKX_resource_misc LEFT JOIN WKX_resource_timestamp ON resourcetimestampId = resourcemiscId) AS WKX_tSELECT DISTINCT resourcemiscId, resourcemiscCollection, resourcemiscPublisher, resourcemiscField1, resourcemiscField2, resourcemiscField3, resourcemiscField4, resourcemiscField5, resourcemiscField6, resourcemiscTag, resourcemiscAddUserIdResource, resourcemiscEditUserIdResource, resourcemiscAccesses, resourcemiscMaturityIndex, resourcemiscPeerReviewed, resourcemiscQuarantine, resourcemiscAccessesPeriod, resourcetimestampId, resourcetimestampTimestamp, resourcetimestampTimestampAdd FROM WKX_resource_timestamp LEFT JOIN WKX_resource_misc ON resourcemiscId = resourcetimestampId ORDER BY resourcetimestampTimestamp DESC LIMIT 0, 25 LIMIT 0, 25
    --> (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 25' at line 1)

    This doesn't happen with select/search result lists.

    Furthermore, the paging in result list is gone awry. I go with the standard 25 no. resources to display/screen in Preferences, and when looking at the details of a resource say in chunk 26-50 and going back with "Last multi view", the header says "Displaying 26 - 50 of 107", but in reality the list is back to the beginning (1-25).

    The navigation buttons happen to disappear when looking at other resources in mono view alternatingly when switching back and forth from multi to momo view.

    Joachim

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-01

    Hi Joachim,

    Can you try the latest SVN please? If you go to the front page after looking at resources from a list operation then go back to last solo view, the navigation buttons will have disappeared if that resource is not displayed on the front page. This is because the list on the front page is treated as a new list and so the navigation buttons are set for resources in that (not the previous list view).

    I've had to do a fair bit of work recently to speed up displays of lists with large numbers of results. Despite paging (as you have 25) I still needed to get the resource IDs for all resources in the list in order to provide the navigation buttons over the list pages (on large numbers of resources, this could add several seconds to the display). I've now come up with a different method that significantly speeds things up -- hence the bugs you've found.

    Let me know if this works please.

    Mark

     
  • Joachim

    Joachim - 2013-05-01

    The front page is OK, the SQL error is gone as well as the warnings, but the problems with list navigation (that is within lists itself, without looking at the front page) persists.

    Select a keyword with many resources, look at one of the resources > buttons OK.
    Select next page, look again at one of the resources > no buttons.
    Select "Last multi view" > list is back at the first page, but states "Displaying 26 - 50 of 172"
    Select one of the resources > buttons OK.
    On next page > no buttons, etc.

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-01

    I don't see any of that ;) I get buttons all the time and returning to last multiview, I get the correct information at the top.

    What happens if you log of and on again (in case sessions are messing things up)?

    I'll look further into it though.

    Regards,

    Mark

     
  • Joachim

    Joachim - 2013-05-02

    I test mostly with read access only, but the same thing if I am logged on as admin. Same thing with several browsers, too.

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-02

    I'll try to get onto it over the next few days Joachim.

    Mark

     
  • Mark Grimshaw

    Mark Grimshaw - 2013-05-05

    Should be fixed in the latest SVN.

    Mark

     

Log in to post a comment.