Problem/Motivation

(I came across this when porting Login History to D8.)

In D7 hook_block_info() had a 'properties' key and the only documented key of properties was 'administrative', a boolean. #1535868: Convert all blocks into plugins removed these docs and moved at least some of the administrative = TRUE properties to blockSettings() methods on the block plugins.

It looks like blockSettings() is now defaultConfiguration() on a block plugin, at least for the case of ForumBlockBase. It seems like all of the other block plugins that were using 'administrative' have now been converted to views.

This 'properties' information ends up in active config but I'm not sure if or how it's used in D8. Most or all of the other data in the defaultConfiguration() methods of other block plugins in core seems to be related to things that a user can configure on the block instance form.

Proposed resolution

Remove the 'properties' from \Drupal\forum\Plugin\Block\ForumBlockBase::defaultConfiguration() or document somewhere what this does and how to use it.

If this is just a simple removal, the component can be changed to forum.module.

Remaining tasks

Figure out what to do.

User interface changes

n/a

API changes

n/a

Issue fork drupal-2251789

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

star-szr’s picture

Title: \Drupal\forum\Plugin\Block\ForumBlockBase::defaultConfiguration() uses a seemingly defunct 'administrative' property » \Drupal\forum\Plugin\Block\ForumBlockBase::defaultConfiguration() uses a seemingly defunct 'properties' key

This might be a more accurate title.

star-szr’s picture

Title: \Drupal\forum\Plugin\Block\ForumBlockBase::defaultConfiguration() uses a seemingly defunct 'properties' key » ForumBlockBase::defaultConfiguration() uses a seemingly defunct 'properties' key

And making the title less unruly while I'm at it.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

tim.plunkett’s picture

Component: block.module » forum.module

It's in forum.schema.yml ¯\_(ツ)_/¯

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

larowlan’s picture

Issue tags: +Novice, +Bug Smash Initiative
dhirendra.mishra’s picture

Status: Active » Needs review
FileSize
502 bytes

Here is the patch below..Kindly review it

Status: Needs review » Needs work

The last submitted patch, 13: 2251789-13.patch, failed testing. View results

imalabya’s picture

Status: Needs work » Needs review
FileSize
1.42 KB

Updated patch to fix the tests.

longwave’s picture

I think the "properties" sections also need removing from forum.schema.yml.

imalabya’s picture

Updated patch to remove the properties from schema.yml

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. The only remaining instances of "properties" in forum module are in RDF mappings, which are unrelated to this issue.

alexpott’s picture

Version: 8.9.x-dev » 9.3.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: -Novice +Needs upgrade path

We need to target 9.3.x. 8.9.x only gets security fixes.

Also this is not this simple. We need to deprecate the schema and update any existing block config because they'll have...

plugin: forum_new_block
settings:
  id: forum_new_block
  label: 'New forum topics'
  provider: forum
  label_display: visible
  properties:
    administrative: '1'
  block_count: 5
visibility: {  }
alexpott’s picture

Fwiw this administrative property thing was removed by #1535868: Convert all blocks into plugins

- *   - properties: (optional) Array of additional metadata to add to the block.
- *     Common properties include:
- *     - administrative: Boolean that categorizes this block as usable in an
- *       administrative context. This might include blocks that help an
- *       administrator approve/deny comments, or view recently created user
- *       accounts.

Not really sure what replaced it or even if it was replaced.

longwave’s picture

Status: Needs work » Needs review
Issue tags: -Needs upgrade path

Addressed #19 and opened an MR.

I am guessing the next tag will be "Needs upgrade path tests", which will be tricky because while forum module is installed in drupal-9.0.0.filled.standard.php.gz, neither of the blocks are placed.

alexpott’s picture

Status: Needs review » Needs work
Issue tags: +Needs upgrade path tests

@longwave your crystal ball is working :)

It's not too bad - you can add a small php file to install the blocks into the config - look in 8.9.x for inspiration in old upgrade tests. 9.x doesn't have so many of them.

longwave’s picture

Status: Needs work » Needs review
Issue tags: -Needs upgrade path tests

Ah yeah, I forgot we can do that.

longwave’s picture

Fixed CSpell issue. I wish testbot would bump issues to NW when they fail like this.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

The added upgrade path looks good.
The fixture adds 2 block with the old properties key set.
The basic filled drupal 9 fixture does not have those block included.
The upgrade test that the properties key gets removed for both blocks.
Back to RTBC.

catch’s picture

Status: Reviewed & tested by the community » Needs review

Question on the MR.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

This came up again in #bugsmash triage. First of all the MR needs bringing up to date as this will have to go into 10.1.x, then @catch's comment still needs addressing.

Ankit.Gupta’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.27 KB

Reroll the patch #17 with Drupal 10.1.x

quietone’s picture

Status: Needs review » Postponed

Forum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11

This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

It will be moved to the contributed extension once the Drupal 11 branch is open.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.