Commit 209a82ce authored by salvis's avatar salvis

Issue #3081936 by Sergiu Stici: Deprecated Code Report.

parent 79d130a4
......@@ -3,10 +3,12 @@ CHANGELOG for Forum Access for Drupal 8
forum_access 8.x-1.x-dev:
Bug fixed:
Bugs fixed:
- #3002918 by salvis, ron_s: Add primary key and index to the {forum_access} table.
- #3016322 by chipway: All dependencies must be prefixed.
- #3028731 by salvis, Tomazetti, g.philippot: Fix Error during migration from D7 to D8 -- fix missing common.inc include and generally postpone includes until needed in forum_access.module.
Tasks:
- #3081936 by Sergiu Stici: Deprecated Code Report.
forum_access 8.x-1.x-alpha0 (2018-04-11):
......
......@@ -8,6 +8,7 @@
use Drupal\comment\CommentInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Database\Query\AlterableInterface;
use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
......@@ -448,9 +449,9 @@ function forum_access_query_taxonomy_term_access_alter(SelectInterface $query) {
[
':uid' => $account->id(),
]);
$query->condition(db_or()
$query->condition((new Condition('OR'))
->isNull("$access_alias.rid")
->condition(db_and()
->condition((new Condition('AND'))
->condition("$access_alias.rid", $rids, 'IN')
->condition("$access_alias.grant_$op", 1, '>='))
->condition("$aclu_alias.uid", $account->id()));
......
......@@ -10,7 +10,7 @@
*/
function forum_access_migrate_install() {
// TODO: WARNING: needs test!
db_delete('forum_access')
\Drupal::database()->delete('forum_access')
->execute();
node_access_rebuild();
}
......@@ -92,7 +92,7 @@ function _forum_access_update_access_records($form_state) {
* Ooperations for batch.
*/
function _forum_access_update_batch_operation($tid, $limit, $count, &$context) {
$node_storage = \Drupal::entityManager()->getStorage('node');
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
if (empty($context['sandbox'])) {
// Initiate multistep processing.
$context['sandbox']['progress'] = 0;
......@@ -116,7 +116,7 @@ function _forum_access_update_batch_operation($tid, $limit, $count, &$context) {
// loads successfully.
if (!empty($node)) {
/** @var \Drupal\node\NodeAccessControlHandlerInterface $access_control_handler */
$access_control_handler = \Drupal::entityManager()
$access_control_handler = \Drupal::entityTypeManager()
->getAccessControlHandler('node');
$grants = $access_control_handler->acquireGrants($node);
\Drupal::service('node.grant_storage')->write($node, $grants);
......@@ -135,11 +135,11 @@ function _forum_access_update_batch_operation($tid, $limit, $count, &$context) {
*/
function _forum_access_update_batch_finished($success, $results, $operations) {
if ($success) {
drupal_set_message(t('The content access permissions have been updated.'));
\Drupal::messenger()->addMessage(t('The content access permissions have been updated.'));
node_access_needs_rebuild(FALSE);
}
else {
drupal_set_message(t('The content access permissions have not been properly updated.'), 'error');
\Drupal::messenger()->addError(t('The content access permissions have not been properly updated.'));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment