Problem/Motivation

\Drupal\media\MediaSourceFieldConstraintsInterface::getSourceFieldConstraints says the return type should be

* @return \Symfony\Component\Validator\Constraint[]
   *   An array of validation constraint definitions, keyed by constraint name.
   *   Each constraint definition can be used for instantiating
   *   \Symfony\Component\Validator\Constraint objects.

But actually, its an array where the keys are validation plugin IDs and the values are options for the plugin.

Steps to reproduce

Proposed resolution

Update the documentation

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#11 interdiff3_11.txt779 bytesroshni27
#11 3367151-11.patch901 bytesroshni27
#3 3367151.patch839 bytesanchal_gupta

Issue fork drupal-3367151

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

larowlan created an issue. See original summary.

anchal_gupta’s picture

Assigned: Unassigned » anchal_gupta
anchal_gupta’s picture

StatusFileSize
new839 bytes

I have uploaded the patch. Please review it.

anchal_gupta’s picture

Assigned: anchal_gupta » Unassigned
Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Seems the 2nd part was left out.

nitin_lama’s picture

Assigned: Unassigned » nitin_lama
nitin_lama’s picture

I didn't get the second part. Can you explain @smustgrave what exactly needs to be done here?
Thanks.

smustgrave’s picture

Assigned: nitin_lama » Unassigned

Doesn't mention what the values are.

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

roshni27’s picture

Status: Needs work » Needs review
StatusFileSize
new901 bytes
new779 bytes

As mentioned in point #5, I have updated .
Please review.

smustgrave’s picture

Status: Needs review » Needs work

@roshnichordiya issue was moved to a MR that's on the correct branch. So work should continue there please. Hiding #11

elber’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

IS talks about updating issue summary. But MR is adding typehints to the functions.

Rishabh Vishwakarma made their first commit to this issue’s fork.

marvil07’s picture

Status: Needs work » Needs review

IS talks about updating issue summary. But MR is adding typehints to the functions.

@smustgrave,

Yes, the current MR is doing changes outside the scope of the IS, namely it is introducing type hints on several places.

Considering the scope here was about to fix documentation, doing only that change is likely what is wanted here.

Even if MR seems to be preferred in general, the existing patch at #11 is already providing the needed change here; and I verified it stills apply correctly.
Hence, I am adding it back for consideration.
The other route is to change the MR to almost rollback everything, or opening a new branch, but that may be too much for the actual 2-lines documentation change here.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Agree patch #11 seems more in line.

Also FYI for a lot of people here, issue was tagged novice for new users. @elber you have over 2000 posts and @roshni27 almost a 1000. Think you are experienced enough and can handle the non novice issues. :)

xjm’s picture

Unless these APIs were only added in 10.2.x, adding new typehints to existing code is a breaking change. We have another RTBC I've already tagged to that effect. They really need to be attached to a parent meta (which probably already exists) where we can discuss it.

dpi’s picture

@xjm the most recent MR is off the rails. The doc only changes are recommended at this time, per previous comments. Can you provide new analysis/remove tag?

longwave’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs release manager review

I agree the typehints are out of scope here and it looks like this should be a docs-only fix. But #11 only changes MediaSourceFieldConstraintsInterface whereas the MR also does change the docs in MediaSourceEntityConstraintsInterface. If this is correct then we should change both at once.

I suggest opening a new MR rather than using patch workflow.

marvil07’s picture

Title: Return type on \Drupal\media\MediaSourceFieldConstraintsInterface::getSourceFieldConstraints is wrong » Return type on two media constraints are misleading
Status: Needs work » Needs review

I agree the typehints are out of scope here and it looks like this should be a docs-only fix. But #11 only changes MediaSourceFieldConstraintsInterface whereas the MR also does change the docs in MediaSourceEntityConstraintsInterface. If this is correct then we should change both at once.

@longwave, that makes sense.
I changed the issue title accordingly too.

I suggest opening a new MR rather than using patch workflow.

I opened a new MR 4264 based on patch #11 and the similar change in the MR for other interface.

Marking the path on #11 as hidden, as well as the previous MR for easier review.

Please feel free to skip contribution credits for me here if needed, since this is a novice task.
I decided to go ahead since (i) there was no activity here for a couple of weeks, (ii) extracting the bits from both an MR and a patch sounds a bit less of the novice side, and (iii) improvements on DX are nice to have.

marvil07 changed the visibility of the branch 3367151-return-type-on to hidden.

marvil07’s picture

Title: Return type on two media constraints are misleading » Docs on return type on two media constraints are misleading
Issue summary: View changes
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Change seems fine.

xjm’s picture

Thanks @dpi for explaining the situation and @longwave for getting it all rescoped correctly.

I had a very small grammar nitpick with the final version, which I fixed on the MR.

  • xjm committed 27c6d955 on 11.x
    Issue #3367151 by marvil07, Anchal_gupta, xjm, smustgrave, larowlan,...

  • xjm committed bc6752e6 on 10.2.x
    Issue #3367151 by marvil07, Anchal_gupta, xjm, smustgrave, larowlan,...

  • xjm committed a848e059 on 10.1.x
    Issue #3367151 by marvil07, Anchal_gupta, xjm, smustgrave, larowlan,...
xjm’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed to 11.x, 10.2.x, and 10.1.x as a patch-safe documentation bugfix. Thanks!

Status: Fixed » Closed (fixed)

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