Needs review
Project:
Simplenews
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Nov 2013 at 12:50 UTC
Updated:
24 Oct 2016 at 03:31 UTC
Jump to comment: Most recent
Paging doesn't quite work on the 'Subscribers' list (admin/people/simplenews), all pages just display the first page.
I can fix it by editing includes/simplenews.admin.inc file in simplenews module directory (simplenews/includes/simplenews.admin.inc)
Edit line 164 and 1106 to:
->limit(0)
Comments
Comment #1
Mantalo Conseil commentedHello,
It makes me a 500 error when I alter includes/simplenews.admin.inc as you wrote ...
Comment #2
karsa commentedCould you detail this further?
Any errors in the webserver (apache) log? Are you certain you didn't put any syntax errors in your code?
Comment #3
harald_ commentedThis Code can't work.
limit / orderByHeader be called before PagerDefault / TableSort Object exists.
Btw: Can not reproduce your Problem under 7.x-2.x-dev BUT had something similar problem with 7.x-1.1 in connection with simplenews_relname module.
Comment #4
gilsbert commentedHi.
I also confirm that the issue happens with 7.x-1.1 in connection with simplenews_realname (7.x-1.1 alone doesn't have this issue).
Perhaps this post should be redirected to simplenews_realname project?
Here https://drupal.org/node/2201387 you can read what is happening with the SQL statement when the issue's scenario (7.x-1.1 plus simplenews_realname) is present at the site.
I did not test 7.x-2.x.
Regards,
Gilsberty
Comment #5
kolyapatrik commentedThis is the soultion
Open includes/simplenews.admin.inc file in simplenews module directory (simplenews/includes/simplenews.admin.inc)
Edit line 164 and 1106 to:
->limit(0)
Comment #6
kolyapatrik commentedComment #7
areynolds commentedCan confirm that this fixes my issue.
Comment #8
polmaresma commented#5 solves the problem on my setup too.
Thank's
Comment #9
mattf100 commentedI also confirm that the issue happens with 7.x-1.1 in connection with simplenews_realname.
I changed the code as per #5, but now I see the following error on the page (doesn't matter if first or second page):
Warning: Invalid argument supplied for foreach() in simplenews_subscription_list_form() (line 1115 of .../sites/all/modules/simplenews/includes/simplenews.admin.inc).
Comment #10
jking1224 commentedI also confirm that the issue happens with 7.x-1.1 in connection with simplenews_realname (7.x-1.1 alone doesn't have this issue).
I think the problem to be fixed is in file: simplenews_realname.module inside function simplenews_realname_form_alter()
But I don't know enough about Drupal code to deal with it. I fiddled around about line 90 or so, and got partially right result, but couldn't fix it.
Comment #11
egarbeil commentedI ran into this issue too - the codefix above will fix the problem. Also, disabling and uninstalling the simplenews realname module fixes it if that is an option. We had 2 clients and tried both options. It works both ways.
The ideal would be to incorporate the fix into the realname module.
Comment #12
mp commented"solution" #5 "works" BUT i get also the same error like #9
Warning: Invalid argument supplied for foreach() in simplenews_subscription_list_form() (line 1113 of [PATH2WEBSITE]/sites/all/modules/simplenews/includes/simplenews.admin.inc).
Comment #13
gnepfedrukka commentedThe Problem is that the wrong pager element will be used, and not the first one.
Open simplenews_realname.module file in simplenews realname module directory (simplenews_realname/simplenews_realname.module)
Around line 109 change:
$result = $query->fields('sn', array('snid', 'activated', 'mail', 'uid', 'language'))
->fields('sr', array('realname'))
->limit(30)
->orderByHeader($header)
->execute();
to
$result = $query->fields('sn', array('snid', 'activated', 'mail', 'uid', 'language'))
->fields('sr', array('realname'))
->limit(30)
->element(0)
->orderByHeader($header)
->execute();
Comment #14
jking1224 commentedI confirm #13 works for me.
Simplenews 7.x-1.1 realname 7.x-1.0-alpha2
added that single line of code.
Thanks gnepfedrukka.