WhatCD / Gazelle

http://whatcd.github.io/Gazelle/
1.84k stars 364 forks source link

Requests page not working. #40

Closed derekisbusy closed 10 years ago

derekisbusy commented 10 years ago

I can add requests and see them in the database but the requests page does not show any requests. I traced it to line 322 of the requests.php...

    $SphRequests = $SphQLResult->to_array('id');

The to_array() function is returning an empty array.

riverstore commented 10 years ago

Please check this line in your crontab

maybe you missed requests_delta

derekisbusy commented 10 years ago

I didn't have requests_delta but it's also not listed on the install page. The install only says:

* * * * indexer -c /etc/sphinxsearch/sphinx.conf --rotate delta

Here is the SphinxqlResult object:

object(SphinxqlResult)#10 (4) { ["Result":"SphinxqlResult":private]=> object(mysqli_result)#8 (5) { ["current_field"]=> int(0) ["field_count"]=> int(5) ["lengths"]=> NULL ["num_rows"]=> int(0) ["type"]=> int(0) } ["Meta":"SphinxqlResult":private]=> array(4) { ["error"]=> string(39) "sort-by attribute 'timeadded' not found" ["total"]=> string(1) "5" ["total_found"]=> string(1) "5" ["time"]=> string(5) "0.000" } ["Errno"]=> int(0) ["Error"]=> string(0) "" }

It's saying "sort-by attribute 'timeadded' not found." Is the requests page working for anyone else?

derekisbusy commented 10 years ago

Okay figured out it was due to the 'timeadded' field not being in the column list. For anyone who has this issue you need to change line 3 of sections/requests/requests.php to:

$SphQL->select('id, votes, bounty, lastvote, timefilled, year, timeadded')->from('requests, requests_delta');