I've just run into an instance of this, while attempting to add a new
page to ocal.

Using the sql like the following works as expected:

SELECT table1.foo, table2.bar FROM table1, table2 GROUP BY table1.foo
ORDER BY table2.bar

When attempting to add pagination, however, no links display.  The
pagination works if I manually add ?page=1 or ?page=3 to the url, but
the links are nowhere to be found.  I've also tried adding the key words
[no_pagination] and [pagination] into the affected widget & still no
success.

-- 
You received this bug notification because you are a member of Aiki
Framework Admins, which is subscribed to aikiframework.
https://bugs.launchpad.net/bugs/579778

Title:
  Pagination breaks if SQL statement contains 'JOIN'

Status in Aiki Framework:
  Confirmed
Status in openclipart:
  Confirmed

Bug description:
  If you attempt to use a SQL statement with 'join' 's user gets a php
  errors :

  sql statement:

  select  posts.post_title, posts.post_content, posts.post_date, term.name as 
category
     from  mywp_florica.wp_1posts posts join 
mywp_florica.wp_1term_relationships rel on posts.id = rel.object_id
                 join mywp_florica.wp_1term_taxonomy tax on 
tax.term_taxonomy_id = rel.term_taxonomy_id
                 join mywp_florica.wp_1terms term on term.term_id = tax.term_id
     where       posts.post_status = 'publish' and posts.post_type = 'post'  
and term.name = 'media' order by posts.post_date desc

  Notice Undefined variable: records_num in
  <b>/var/www/floricavlad.com/system/widgets.php on line 397

  Notice Undefined variable: records_num in
  <b>/var/www/floricavlad.com/system/widgets.php on line 399

  This is using aiki 337, note, the page still returns the proper
  record. The 'records in page' field is set to 1.

  My guess is that aiki isn't counting the records properly... am trying
  to figure this out.. pagination needs to work better.

  -- Update -- 
  looked at the code

  this line is causing problems

  echo preg_match('/select(.*)from/i', $widget->normal_select,
  $selectionmatch);

  it does not properly populate the $selectionmatch array because it is
  not checking for join statements ... think about passing the query
  straight in, adding a count(*) to get that array to populate..

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework.admins
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework.admins
More help   : https://help.launchpad.net/ListHelp

Reply via email to