Comments

nickolaj created an issue. See original summary.

nickolaj’s picture

nickolaj’s picture

Assigned: nickolaj » Unassigned
Status: Active » Needs review
Issue tags: +Drupal 9 readiness

Status: Needs review » Needs work

The last submitted patch, 2: forum_access-drupal_9_readiness-3129859-2.patch, failed testing. View results

kristen pol’s picture

Fixing outdated tag.

dillix’s picture

@nickolaj thanks for your patch, but I've found several issues for D9 compability:

1) web/modules/contrib/forum_access/forum_access_migrate/forum_access_migrate.install
Line 8: Call to deprecated function db_delete(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call delete() on it.

2) web/modules/contrib/forum_access/includes/forum_access.admin.inc
Line 92: Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use Drupal::entityTypeManager() instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service.

3) web/modules/contrib/forum_access/includes/forum_access.admin.inc
Line 116: Call to deprecated method entityManager() of class Drupal. Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use Drupal::entityTypeManager() instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service.

4) web/modules/contrib/forum_access/includes/forum_access.admin.inc
Line 135: Call to deprecated function drupal_set_message(). Deprecated in drupal:8.5.0 and is removed from drupal:9.0.0. Use Drupal\Core\Messenger\MessengerInterface::addMessage() instead.

5) web/modules/contrib/forum_access/includes/forum_access.admin.inc
Line 139: Call to deprecated function drupal_set_message(). Deprecated in drupal:8.5.0 and is removed from drupal:9.0.0. Use Drupal\Core\Messenger\MessengerInterface::addMessage() instead.

6) web/modules/contrib/forum_access/forum_access.module
Line 411: Call to deprecated function db_or(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an OR conjunction: new Condition('OR');

7) web/modules/contrib/forum_access/forum_access.module
Line 413: Call to deprecated function db_and(). Deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an AND conjunction: new Condition('AND');

8) web/modules/contrib/forum_access/forum_access_migrate/forum_access_migrate.info.yml
Add core_version_requirement: ^8 || ^9 to designate that the module is compatible with Drupal 9.

mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new835 bytes
new346 bytes

Updated patch #2 by adding core_version_requirement: ^8 || ^9 in the forum_access_migrate.info.yml file. And other deprecations mentioned in #6 seems to be already fixed in the branch 8.x-1.x, please review.

Status: Needs review » Needs work

The last submitted patch, 7: forum_access-drupal_9_readiness-3129859-7.patch, failed testing. View results

mrinalini9’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 7: forum_access-drupal_9_readiness-3129859-7.patch, failed testing. View results

Mfgr45’s picture

Any further evolutions envisaged to make the module D9-compatible ?

I tried to make it work with the core_version_requirement: ^8 || ^9 and it seemed to work properly for a moment.
But if I try to create a forum with sub-forums, configure roles and then add a topic in it, I get this issue :

Call to undefined method Drupal\node\NodeAccessControlHandler::writeGrants() in forum_access_node_insert() (line 231 of modules/custom/forum_access/forum_access.module).

A new contribution appears in the "Topic" column of /forum page but when you click on it it's like it does not exist. And nothing appears in the "Last post" column. So basically we can't create a proper new topic.

Hope this will help for the transition from D8 to D9.

Mfgr45’s picture

I solved my previous issue and add it to the previous patch.

freelock’s picture

Status: Needs work » Needs review

Looks like there's a patch here that has not been tested...

salvis’s picture

Status: Needs review » Needs work
Mfgr45’s picture

Status: Needs work » Needs review
StatusFileSize
new1.56 KB

Here is a fix of my previous patch.

Status: Needs review » Needs work

The last submitted patch, 15: forum_access-drupal_9_readiness-3129859-15.patch, failed testing. View results

Mfgr45’s picture

Status: Needs work » Needs review
salvis’s picture

Issue summary: View changes
Christopher Riley’s picture

It would be nice if we at least had a version that would install on Drupal 9 so that we could use composer to manage the module. I know that I can pull it and patch it myself but I grow lazy in my old age.

jackg102’s picture

Completely new to contribution -- not Drupal itself though -- please be kind :- ). I went and tested patch #15 locally on my machine. It is a Drupal 9.1.10 site with the origin/8.x-1.x branch checked out -- I cloned the repo locally and had to get the other ACL module. I found that the patch applied cleanly, and the functionality to block access to forums worked at a basic level, when I configured it to block anonymous users from visiting forums.

However, the problem creating a sub-forum produced an error: "Notice: Undefined index: update_choice in _forum_access_update_access_records() (line 59 of /var/www/web/modules/contrib/forum_access/includes/forum_access.admin.inc)"

Not sure if this is a separate issue referenced in #11.

Was thinking about using this module for a company project rather than a custom solution, but it's a Drupal 9 project.
Edit: After fiddling with it more, the issue has disappeared with creating a sub-forum and no more error, maybe I didn't do something with rebuilding permissions. If I have time, I'll try to reproduce this error, but the access blocking works with sub-forums as well with topics in the sub-forums.

Notice: Undefined index: update_choice in _forum_access_update_access_records() (line 59 of /var/www/web/modules/contrib/forum_access/includes/forum_access.admin.inc)
#0 /var/www/web/core/includes/bootstrap.inc(305): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/web/mo...', 59)
#1 /var/www/web/modules/contrib/forum_access/includes/forum_access.admin.inc(59): _drupal_error_handler(8, 'Undefined index...', '/var/www/web/mo...', 59, Array)
#2 /var/www/web/modules/contrib/forum_access/forum_access.module(641): _forum_access_update_access_records(Object(Drupal\Core\Form\FormState))
#3 [internal function]: _forum_access_admin_forum_form_submit(Array, Object(Drupal\Core\Form\FormState))
#4 /var/www/web/core/lib/Drupal/Core/Form/FormSubmitter.php(113): call_user_func_array('_forum_access_a...', Array)
#5 /var/www/web/core/lib/Drupal/Core/Form/FormSubmitter.php(51): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState))
#6 /var/www/web/core/lib/Drupal/Core/Form/FormBuilder.php(593): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState))
#7 /var/www/web/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm('taxonomy_term_f...', Array, Object(Drupal\Core\Form\FormState))
#8 /var/www/web/core/lib/Drupal/Core/Entity/EntityFormBuilder.php(48): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\forum\Form\ForumForm), Object(Drupal\Core\Form\FormState))
#9 /var/www/web/core/modules/forum/src/Controller/ForumController.php(260): Drupal\Core\Entity\EntityFormBuilder->getForm(Object(Drupal\taxonomy\Entity\Term), 'forum')
#10 [internal function]: Drupal\forum\Controller\ForumController->addForum()
#11 /var/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#12 /var/www/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#13 /var/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#14 /var/www/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#15 /var/www/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#16 /var/www/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#17 /var/www/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /var/www/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /var/www/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /var/www/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 /var/www/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/web/core/lib/Drupal/Core/DrupalKernel.php(706): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#26 {main}

  • sadashiv committed e0c7bbe on 8.x-1.x
    Issue #3129859 by Mfgr45, mrinalini9, nickolaj: Drupal 9 readiness
    
sadashiv’s picture

Status: Needs review » Fixed

Thanks all for the patches, have commited this code.

Thanks,
Sadashiv

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.