Problem/Motivation

While working on several other patches/issues I stumbled across several bits of code I wanted to clean up, but none of the changes fit within the other patches or were big enough issues to warrant their own, so I'm bundling them all here (patches will follow).

Steps to reproduce

N/A

Proposed resolution

N/A

Remaining tasks

RTBC & merge

User interface changes

None.

API changes

  1. Renamed the misspelled 'TablefieldFormatter::$ModuleHandler' to the expected 'TablefieldFormatter::$moduleHandler'
  2. Removed the default value of the unused property '#add_row'

Data model changes

N/A

Issue fork tablefield-3170043

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:

Comments

s.abbott created an issue. See original summary.

s.abbott’s picture

s.abbott’s picture

Forgot to rename the files to include the issue #! Reuploading with correct name (contents are identical).

s.abbott’s picture

Status: Active » Needs review
chuyenlv’s picture

Tested with Drupal 10 and I see some errors:
- Deprecated function: Creation of dynamic property Drupal\tablefield\Plugin\Field\FieldFormatter\TablefieldFormatter::$ModuleHandler is deprecated
- Deprecated function: Creation of dynamic property Drupal\tablefield\TableValue::$value is deprecated
I create the patch to fix these errors.

grimreaper’s picture

Hi,

Thanks for the patch comment 5, it solved the warnings.

dylan donkersgoed’s picture

The clean-code-deprecated-dynamic-property-3170043-5.patch patch no longer applies to the latest dev/2.5-rc1 versions because the moduleHandler property name has been fixed. Attaching a new patch which includes only the setValue fix.

erutan made their first commit to this issue’s fork.

erutan changed the visibility of the branch 8.x-2.x to hidden.

  • erutan committed eb087153 on 8.x-2.x
    Issue #3170043 by s.abbott, chuyenlv, dylan donkersgoed: Code cleanup
    
erutan’s picture

Title: Code cleanup » Code cleanup, including deprecated function: Creation of dynamic property
Status: Needs review » Fixed

Patch #7 applies cleanly to dev / RC2 and solves the issue. This is the most important patch,

The following two patches have already been implemented:

3170043-code-cleanup--fix-indentation-3.patch
3170043-code-cleanup--fix-capitalization-3.patch

The following patch applies cleanly:

3170043-code-cleanup--add-return-documentation-3.patch

The following patch has been confirmed that there is no add_row property and applies cleanly:

3170043-code-cleanup--remove-unused-property-3.patch

liam morland’s picture

Should this be cherry-picked onto branch 3.0.x?

erutan’s picture

The bugfix should be universally applied, the code cleanup is trivial but universal. It'd be nice to not have future patches have to deal with it (the capitalization of moduleHandler was fixed at least 3 times in different patches). It should be in both branches.

  • liam morland committed fea05d62 on 3.0.x authored by erutan
    Issue #3170043 by s.abbott, chuyenlv, dylan donkersgoed: Code cleanup
    

Status: Fixed » Closed (fixed)

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