Move block content creation methods to a trait

Created on 8 April 2019, about 6 years ago
Updated 20 February 2025, 2 months ago

Problem/Motivation

There are a lot of createBlockContentType() and createBlockContent() defined all over the place and this is not consistent with code reuse.

Proposed resolution

  • Centralize all createBlockContentType() and createBlockContent() methods in a new BlockContentCreationTrait.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component

block_content.module

Created by

πŸ‡·πŸ‡΄Romania claudiu.cristea Arad πŸ‡·πŸ‡΄

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Converting FieldTypeTest was completed in 3414259. The remaining part here is to create a trait for the creation of blocks.

    I am changing the title for that new goal and removing the parent.

  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • First commit to issue fork.
  • Pipeline finished with Failed
    10 days ago
    Total: 220s
    #474452
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Started this from scratch as much of the patch no longer applied. I've updated other tests that call something similar to createBlockContent with the trait where possible with aliases.

    I've also added another optional $values parameter to createBlockContent to support tests which were passing these to their own functions, we can then deprecate the $title and $bundle params at a later date if required.

  • Pipeline finished with Success
    10 days ago
    Total: 509s
    #474456
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This seems like a good refactor and have no objection to it as another sub-maintainer hat. Not sure if it needs a CR as a new test trait but we'll see!

Production build 0.71.5 2024