I would like to fix it before the API becomes settled.

The changes are of the form...

ContentTranslationHandlerInterface::getSourceLangcode($form_state) should be

ContentTranslationHandlerInterface::getSourceLangcode(FormStateInterface $form_state)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

martin107’s picture

Issue tags: +FormState

Its is been suggested that should be covered by one of the existing FormState issues...

I have to say I have looked and found that it was not covered.

I am broadening the scope to look for similar examples in core - here is what I have found in other places.

\Drupal\search\Plugin\SearchPluginBase::buildSearchUrlQuery($form_state)

\Drupal\views\Form\ViewsForm::getFormObject($form_state)

admin.inc views_ui_build_form_path($form_state)

\Drupal\system\Form\ModulesListForm::buildModuleList($form_state)

martin107’s picture

Component: content_translation.module » forms system

Status: Needs review » Needs work

The last submitted patch, FormState-0.patch, failed testing.

tim.plunkett’s picture

Title: ContentTranslationHandlerInterface must use FormStateInterface in all cases. » Use FormStateInterface for all typehints
Status: Needs work » Needs review
FileSize
45.49 KB

I didn't have an issue but I did have a patch. Thanks @martin107!

Status: Needs review » Needs work

The last submitted patch, 4: form_state-2313823-4.patch, failed testing.

tim.plunkett’s picture

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

Ughhh.

Status: Needs work » Needs review
tim.plunkett’s picture

FileSize
45.49 KB

Probably need to reupload it, actually.

martin107’s picture

Issue summary: View changes

All my finds are addressed and then some. so +1

In terms of review, all changes are in scope, and appropriate.

Summary changes - No longer a two line fix.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

#8 looks good to me. I see no further functions that should be typehinted with grep -r form_state core | grep function | grep -v FormState

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 5f4bbab and pushed to 8.x. Thanks!

  • alexpott committed 5f4bbab on 8.0.x
    Issue #2313823 by tim.plunkett, martin107: Use FormStateInterface for...

Status: Fixed » Closed (fixed)

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