Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2015 at 19:26 UTC
Updated:
17 Feb 2016 at 11:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
istryker commentedhttp://drupal.stackexchange.com/questions/130249/permissions-not-saving
Easy way to test is edit the permissions for a specific role. Usually that does not exceed 1000 checkbox. If it saves then the problem I quote is your problem.
If it is then please close this issue.
Comment #2
kale_ commentedI've unchecked lots of checkboxes. No effect. Can't still check this permission.
Comment #3
istryker commentedIf you are having problems with multiple checkboxes then the problem is Drupal/PHP settings. Not Scheduler module. Search for "Cannot save permissions in Drupal" on the internet. Closing issue.
Comment #4
jonathan1055 commentedHi kale,
Did you manage to solve your problem? Maybe you have a large number of modules and many roles, thus creating a huge number of checkboxes in the form. Did you try editting the permissions just for a single role?
iStryker,
Thanks very much for your input. However, please may I request that you do not set the status to 'maintainer needs more info' when you are not actually a maintainer of this module. I do appreciate that you have good ideas and thank you for the link, but please do not close the issue before an actual maintainer has at least seen it and had a chance to contribute.
Cheers
Jonathan
Comment #5
kale_ commentedBut I can check other checkboxes. It's only about Permission for "Schedule content publication Allows users to set a start and end time for content publication"
I've checked and unchecked a huge amount of checkboxes. Every work fine.
I also change the php max input. Without result.
I do not have many roles (4) but have a lot of modules.
Comment #6
Anonymous (not verified) commentedSorry iStryker, same issue here on saving permissions for "Schedule content publication" only. Using Scheduler 7.x-1.3 and Drupal 7.38. Same result when using latest dev version.
I did already check my max_input_vars and related settings and the error remains when I use https://www.drupal.org/project/filter_perms for example.
Comment #7
jonathan1055 commentedHi kale and moostdijk,
OK, you obviously have a problem, but I agree with iStryker that this is not specifically and solely a Scheduler bug. That permission works ok for me, so here are some things to try:
Comment #8
Anonymous (not verified) commentedHi jonathan1055,
Thanks for your prompt reply.
1. On the same server, I tried a clean 7.38 install. Then installed Scheduler and see "Schedule content publication" activated for the administrator role. Then when I check the box on this line, for "authenticated user" and then Save permissions, I see that nothing is saved and the checkbox for "administrator" is unchecked as well.
Furthermore, equal to kale, other permissions can be saved, both on my fully loaded site and on the clean install.
2. Yep, checkbox is tickable and after saving, the box is unticked.
3. No, only for "Schedule content publication", not for the other Scheduler access rights nor other permissions.
Did some more testing and the attached patch works for me.
Comment #9
jonathan1055 commentedThanks for the excellent feedback, and for your testing. Now we are really getting somewhere.
So it seems there is a problem with punctuation in the permission machine name. That's fine, we can work round that and fix it. But interesting that it is not a problem on all sites. Maybe the php version affects it? or more likely the database engine. What database and version do you have? I wonder if those values are cleaned, either on saving to the role_permission table, or on retrieval.
Can you do your test again, without your patch, and look at the role_permission table for module='scheduler' after your clean install, and then after the first save (which fails to re-tick the permission). This is very good progress. Thanks.
Comment #10
Anonymous (not verified) commentedOn this server the PHP version is 5.5.21 and InnoDB engine (MySQL 5.5.41).
Values seem to be cleaned on save, see attached screenshots for the records in role_permission for %scheduler% on install and after checking "authenticated user" on the line of "Schedule content publication".
Comment #11
jonathan1055 commentedThanks for the screen shots. On the 'clean install' image it has all three scheduler permissions, but this does not seem right. After an initial install of a module there should be no permissions enabled. Also your table hae role 3, but the anonymous user I thought was role 1. Can you check that again, please? Or are you installing with a package or script which turns on some settings automatically?
At least this shows that the db table can accept the brackets in the text. So now we need to find out what is causing that row to be deleted at some later stage.
Comment #12
jonathan1055 commentedMoostdijk,
Did you do any more work on this? Can you try with a clean minimal D7 installation + Scheduler (without the patch from #8), and show us the db table rows.
Kale_,
Please could you tell us what PHP and database version you are using. Could you also try doing a clean minimal D7 install as described above, and show the scheduler rows in role_permission db table.
Thanks
Jonathan
Comment #13
Jordanmt commentedI've encountered the same issue, running Drupal 7.41 with PHP 5.6.15 and MySQL 5.0.11-dev and resolved it by removing the brackets as in #9. It's not my environment but I'll try and provide additional info if I can.
Comment #14
Jordanmt commentedThe earlier workaround patch changes the machine name in hook_permission(), which made the permissions page functional but I still had the issue that the scheduling tab was not present on node editing pages where it ought to be.
This patch includes that change but also updates the access callback and node form alter to use the same machine name. I'm now seeing the scheduling tab.
Comment #15
jonathan1055 commentedHi Jordanmt,
Thanks for the patch. Yes, I realised when the patch in #8 was added, that it was not a sufficient change. However, I wanted to try to find out what was causing the problem, as clearly it only affects a small proportion of our users. So I had resisted fixing it straight away.
Thanks for the background info in #13. I am on D7.41, PHP 5.5.27 and MySQL 5.5.29 and cannot replicate it. Moostdijk in #6 had PHP 5.5.21, InnoDB MySQL 5.5.41 and did get the problem. So I'd be surprised if any of those were the cause.
You say that it's not your environment, so you probably cannot mess around with it too much, but could you tell us what other modules you have enabled? Or better still, if you have a dev site you can try on, progressively disable the modules and see which one finally makes the existing (unpatched) permissions work OK. Or maybe it is some combination of configuration settings?
Jonathan
Comment #18
jonathan1055 commentedYour patch did not update the .test file, hence all the failures. Also we need a hook_update to correct the existing permissions, which I have added.
We would need to fix this in 8.x first, but useful to have this patch here for now, given that there are some users who will need it.
Comment #19
jonathan1055 commentedAdded proper message at end of hook_update and also changed the text in README.txt so a search for the old permission name does not find anything. The readme is way out of date anyway, but that's another problem.
Comment #20
joekersJonathan, not sure if you've started on the D8 version but here's a patch anyway.
I'll need to re-roll #2651448: Publish and Unpublish fields are shown for users who do not have the permission if this gets committed first as it checks this permission.
Comment #21
jonathan1055 commentedGreat timing, I was just about to start, so thanks for this.
Tests manually and seems to be fine. Yes the patch in that other issue will have to be re-rolled.
Changed the version to 8.x to see how the tests run (should be the same as the branch - 13 pass, 5 fail)
Comment #23
jonathan1055 commentedJoe, we now know that changing the version to 8.x and status to 'needs review' allowed your patch in #20 to be tested, but it was tested at the issue version when that patch was uploaded. Here it is again, and this time it should be tested against 8.x. I have renamed it but not changed the content at all.
Comment #27
jonathan1055 commentedCommitted to 8.x and 7.x. Even though we did not fully get to understand what caused the problem (as it was outside Scheduler) the fix was simple and reliable so I decided to go ahead anyway.
Thanks Joekers, moostdijk, jordanmt, kale_ and iStryker.
Comment #28
joekersThat's good to know about the tests running on the version number of the issue when the patch was submitted :) thanks.