Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Please check my port to Drupal 8 (beta 10)
I have tested it with my port of Content Access module (https://www.drupal.org/node/2032001)
Tests won't pass because issue version is 7.x, you can run them manually to ensure that they are working
I see that you are seeking for co-maintainers. Can I also ask you for permissions to maintain 8.x branch?
Comments
Comment #1
id.tarzanych CreditAttribution: id.tarzanych commentedComment #3
id.tarzanych CreditAttribution: id.tarzanych commentedComment #4
salvisThank you for your work, id.tarzanych!
I need to create a D7 release and from that a D8 branch, but I'd like #2385183: Oracle Support to go into the D7 release first.
Also, for D8, we need to rename the 'number' column because 'number' is a reserved word. The closest we can get is probably 'figure', but I'd use that only for the database table and keep the parameters unchanged.
Thank you for offering co-maintainership. Please stick around and see this through to release. You're very new to Drupal and I can't give you commit access right away, but I'm very interested to have you on board!
Comment #5
id.tarzanych CreditAttribution: id.tarzanych commentedThanks for review, salvis!
I've analyzed #2385183: Oracle Support
metallized used number_acl for field name.
Should I proceed with that, or use figure table field name?
Comment #6
salvisRe: #2385183: Oracle Support
Both names are weird in their own way, but number_acl could more easily be misinterpreted (as having a meaning that it doesn't), so I'd prefer figure.
The trouble is I don't have an Oracle installation to investigate/test this and I don't know whether it's just that column name that causes problems or if there's more...
We'll need a D7 release and a D8 branch so that you can create a patch against 8.x-1.x-dev before I can really look at it and commit it.
Comment #7
id.tarzanych CreditAttribution: id.tarzanych commentedThanks, waiting for D8 branch
Comment #8
id.tarzanych CreditAttribution: id.tarzanych commentedPatch tested with Drupal 8 beta11, works correctly
Comment #9
toamit CreditAttribution: toamit commentedPlease open D8-dev branch, rather than making interested contributor wait.
Comment #12
wwedding CreditAttribution: wwedding at Sticky Co commentedWhat exactly does "a d7 release" mean. With my understanding of the terms, a "d7" release happened back in 2011 when 1.0 was made live. Do you mean "1.1" is overdue and you want that done, first?
Could one of the maintainers create a task with "release blockers" attached, describing what the goals are and why they're preventing any progress in d8.
Comment #13
salvisIt's good practice to create a tag and release before branching, so that we have a well-defined base for D8.
8.x-1.x-dev is ready now.
Comment #15
salvisWow, green at the first try!
Comment #16
id.tarzanych CreditAttribution: id.tarzanych commentedThat's good
I'll update patch according to your requirements
Comment #17
salvisThere are some things that we should do, going from D7 to D8:
I wonder whether we can get away with writing an acl_update_8001() function to change the database schema (or whether we really need the Migrate API). Accroding to Upgrade API, hook_upgrade_NNN() is not run during major upgrades, but Migrate API is overkill just for renaming a column...
There'll probably be more.
And we'll need testing by everyone!
Comment #18
id.tarzanych CreditAttribution: id.tarzanych commentedSeems that we'll have to use Migrate API and create mapping.
Other things are done. Tested on Beta15
Comment #19
salvisHmm, if I understand https://www.drupal.org/node/2186315 correctly, then every contrib needs to implement the Migrate path...
The 'number' column wasn't introduced until acl_update_7000(), and direct upgrading from D6 needs to add (not just rename) the column.
Comment #20
id.tarzanych CreditAttribution: id.tarzanych commentedPlease review a new patch.
I've added migration template, source, destination plugins, covered migration process with Simpletest.
By the way, ACL for Drupal 6 has `number` column in `acl` table. It is introduced in acl_update_6002().
I couldn't find detailed documentation about that, so please tell me if you have any suggestions
Comment #22
id.tarzanych CreditAttribution: id.tarzanych commentedHm, PHP 7 test doesn't want to pass... Will install it tomorrow
UPD: I am a bit confused. It's green, but patch failed testing
Comment #23
id.tarzanych CreditAttribution: id.tarzanych commentedAccording to #2454439: [META] Support PHP 7 Drupal 8 currently is not fully compatible with PHP 7
I've installed PHP 7 on my machine and I get
Error: Cannot access protected property Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::$storage in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->getSchemaFromStorageDefinition() (line 212 of /var/www/drupal8/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php).
fatal error even in vanilla Drupal 8 beta 15 on some of configuration pages
Comment #24
id.tarzanych CreditAttribution: id.tarzanych commentedComment #26
salvisThank you for the updated patch, id.tarzanych!
Any reviewers/testers out there?
Are there any client modules for ACL yet?
Comment #27
id.tarzanych CreditAttribution: id.tarzanych commentedI've also ported Content Access module to Drupal 8. This module consists Simpletest cases for ACL.
https://www.drupal.org/node/144819/git-instructions/8.x-1.x
I received co-maintainer access 3 months ago, but without ability to create releases #2504653: Co-maintainer access to Content Access module (D8 version).
I need to develop Migrate mappings there as well, going to request dev-8.x-1.x release create after that.
Can I ask you for feedback in the future drupal.org issue?
Comment #30
salvisNow that CI seems to work for contribs, I've enabled the non-MySQL databases as well, and apparently they're still causing issues.
I'm not sure I understand -- I'll be happy to help where I can, but you're ahead of me as far as D8 is concerned...
Comment #31
id.tarzanych CreditAttribution: id.tarzanych commentedI'll work on non-MySQL databases support
However I am not sure that
is caused by ACL code
Comment #32
salvisWhere did you see that?
I think the errors for pgsql and sqlite are in the database layer. The db_insert()->from($subselect) should create a parenthesis around the SELECT but apparently doesn't.
Comment #33
id.tarzanych CreditAttribution: id.tarzanych commentedFound that in Drupal CI Jenkins log.
I haven't checked Drupal 8 on PostgreSQL yet, will try to do that tomorrow or on Saturday
Comment #34
id.tarzanych CreditAttribution: id.tarzanych commentedLet's test updated patch
Comment #43
id.tarzanych CreditAttribution: id.tarzanych commentedOne more attempt
Comment #52
id.tarzanych CreditAttribution: id.tarzanych commentedDrupalDumpBase was removed a day ago.
Thanks to chx for pointing at that
Comment #53
id.tarzanych CreditAttribution: id.tarzanych commentedReworked Drupal 8 ACL Migration Test classes according to updated Drupal Core structure
Comment #54
id.tarzanych CreditAttribution: id.tarzanych commentedGreen :)
At last
Comment #55
salvisFantastic -- this is really great!
Here are a some comments from looking through the code, in no particular order:
1. CHANGELOG.txt: Please add periods at the end of the items.
2. README.txt line 65: Change to 8.x
3. acl.install:
I wonder whether it would make sense to take the opportunity and reverse the indexes, i.e. have 'module_figure_name' and 'module_name', because an int index is probably more efficient than a varchar index. What do you think?
4. acl_create_acl() was somewhat permissive by allowing calls with the same arguments and returning the matching $acl_id if the record already existed. This was not documented but still a potentially useful feature. You've changed drupal_write_record() to db_insert() which would cause an error in this case. Can we use db_merge(), write a test, and document the feature?
5. Let's remove acl_create_new_acl().
6. acl_add_nodes(): We should keep the db_insert()->from($subselect) for MySQL. If the others need a clumsy work-around that should not go at the expense of MySQL.
7. _acl_module_load_include() is not used anymore, remove.
8. acl_node_access_explain() and acl_node_test_node_grants(): I like functional programming. Unless there's a clear benefit to having a variable I like avoiding one-time-use variables, especially if they lead to odd naming such as
foreach ($users as $account)
.9. AclWebTestCase.php: Why is this class called AclWebTestCase and not AclTest?
10. AclWebTestCase: We don't really need $web_user to be a property. I made an exception to my rule to not define one-time-use variables, because I wanted to show the familiar pattern and use the familiar name. Making it a local variable implies that we won't use any other users.
11. AclWebTestCase::setUp(): entity_create() is deprecated.
12. AclWebTestCase::setUp(): Please fix 'succesfully' to have one more 's' (wrong in the D7 version).
13. d6_d7_table.php: D6 does not have a 'number' column.
14. It seems we're only migrating the {acl} table at this point. What about the other tables?
15. The migration tests don't test anything yet, do they?
16. acl.install: It makes no sense to keep the old hook_update_NNN() implementations, does it? Please remove them.
I haven't done any actual testing yet.
Comment #56
id.tarzanych CreditAttribution: id.tarzanych commented3. I'll analyze that
4. Sure
6. I've changed insert from subselect to db_insert, because it causes errors in PostgreSQL and SQLite despite their syntax supports that. I'll check what can I do here
13. Drupal 6 version DOES have number column (https://www.drupal.org/node/936682)
14. Will check that
15. They test number to figure property migration
Comment #57
salvisRe 6.: We should be able to do something like
Re 13.: Ah, yes, you're right. I was confused because I saw acl_update_7000() adding the 'number' column. But it was also added in acl_update_6002().
Yes, but that still leaves a lot of room for things to go wrong. We're really missing devel_node_access.module in D8 at this point.
Comment #58
id.tarzanych CreditAttribution: id.tarzanych commentedRe 6: Good point. Will do that
Comment #59
id.tarzanych CreditAttribution: id.tarzanych commentedLet's try this patch
I've completed Migrate mappings and covered them with tests.
I've put testMigration() class into a trait, because test cases are equal for Drupal 6 and Drupal 7.
Most of all I am concerned about acl_create_acl.
merge() method returns us only STATUS_INSERT or STATUS_UPDATE, but seems that there is no other mechanism to get acl_id than add an extra query. What do you think about that?
Comment #61
id.tarzanych CreditAttribution: id.tarzanych commentedFixed field type in D6/D7 dump file
Comment #62
id.tarzanych CreditAttribution: id.tarzanych commentedPassed tests.
salvis, please check this patch
Comment #63
salvisYou're right with your concern about db_merge(), and it's deprecated, too!
Also, the code in Merge::execute() is not what I was counting on. I was hoping for an SQL MERGE query, but apparently that's not what we're getting.
So I agree with going with db_insert(). Those who need the old undocumented functionality can do their own query.
Comment #64
id.tarzanych CreditAttribution: id.tarzanych commentedIs everything else affirmative for you?
I hope I'll be able to change db_merge to db_insert shortly.
Comment #65
id.tarzanych CreditAttribution: id.tarzanych commentedChanged db_merge() to db_insert() in acl_create_acl() function.
After that I decided to get rid of deprecated functions and classes in ACL module code (db_select(), db_insert(), db_delete(), db_update(), SafeMarkup) and replaced them with latest Drupal 8 core functions. Then I improved code styling where it was possible.
Comment #66
salvisThis looks very good, thank you!
!empty() is wrong. empty() would be much closer, but still not the same as !isset(). We need !isset() here, so that the caller can pass '' (an empty string).
The ultimate guide to these functions (actually they're language constructs and not functions) is http://php.net/manual/en/types.comparisons.php .
Inconsistent formatting for fetchField() (just to show that I'm paying attention :-)). Core is inconsistent, too, but putting the arrow operator is the way to go, as you've put it everywhere else.
(This is really a tiny nit that I wouldn't have mentioned if we didn't have #1 above.)
Dreditor does not like having no newline at the end of text files.
I've been wrestling with enabling OPCache in my WAMPP installation, without success so far, and I'll be offline on a business trip for the rest of the week, but I promise I'll do actual testing on Saturday.
Comment #67
id.tarzanych CreditAttribution: id.tarzanych commentedRe 1: Ah, yes, my mistake, sorry. I should be more concentrated
Will fix others today
Comment #68
id.tarzanych CreditAttribution: id.tarzanych commentedFixed
Comment #69
id.tarzanych CreditAttribution: id.tarzanych commentedComment #72
id.tarzanych CreditAttribution: id.tarzanych commentedProbably core was updated again... I fixed styling only
Comment #77
salvisIt looks like the result list just keeps getting longer when you retest, rather than just showing the last result for each test. At this point we only have the "PHP 7 & MySQL 5.5" test failing, which we ignore for now.
Comment #79
salvisArgh, whenever we set to NR, it requeues the five tests that are functional (the PHP 5.4 tests aren't), and adds five results.
So, if anyone has an interest here, this is Needs Review and testing.
Comment #80
MixologicYou probably do not want to set every single environment to issues and commit then.
https://www.drupal.org/node/87985/qa
Ideally you have just mysql5.5 and php5.5 set to issues and commit, and the rest set to just branch on commit. That way every patch doesnt spin up five testbots to over validate potential work in progress, and when that work gets comitted, it can warn of any other outstanding regressions.
Comment #81
id.tarzanych CreditAttribution: id.tarzanych commentedComment #83
salvisI put the empty lines back into README.txt and CHANGELOG.txt and updated the latter. No other changes to #68.
Thank you for all your work and your perseverance, id.tarzanych!
We have a great baseline with your patch — I've tagged it as 8.x-1.x-alpha1.
Testing continues in #2596089: ACL for D8 — ALPHA1.
(Mixologic: Thanks for your hints in #80.)
Comment #84
id.tarzanych CreditAttribution: id.tarzanych commentedThank you too, salvis!
I am currently working on Content Access port
It doesn't work with the latest core release.
Can I ask you for your review and feedback in the future?
Comment #85
salvisYes, sure. I can't guarantee fast follow-up though...
Also, as far as CA is concerned, I don't know its internals and I'm not sure whether the D7 version is really working, which makes things pretty difficult... I've posted #2596099: Create a D8 snapshot release to nudge fago -- hope it helps...
You asked for co-maintaining ACL for D8 -- I'd be happy to have you on board and I've added your ID to the list. Please take a look at Best practices for co-maintaining projects.
Do you know Devel Node Access? I consider it pretty much indispensable for working on a node access module, but unfortunately I haven't had time to work on the D8 version. Would you be interested to give it a try?
Comment #86
id.tarzanych CreditAttribution: id.tarzanych commentedYes, for sure. But I see that it is already ported, at least partly.
I'll test that.
Done
Comment #87
salvisYes, somewhat, but it's not working at all right now:
#2380335: Devel Node Access block is broken
#2208875: Fix fatal errors in devel_node_access following hook_menu removal
Comment #88
id.tarzanych CreditAttribution: id.tarzanych commentedOkay, I'll see what I can do