Reviewed & tested by the community
Project:
Reference field option limit
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Nov 2018 at 21:55 UTC
Updated:
12 Dec 2022 at 20:12 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
solideogloria commentedI have this problem, too.
Comment #3
nikunj.shah commentedComment #4
nikunj.shah commentedHi jennine,
This patch will solve it. Please find the attachment.
Thank you.
Comment #5
solideogloria commentedWill
$bundlesever be equal to empty string? At the very least, I don't think that it should beif ($bundles && $bundles != ''), because the second half of that if statement will never be checked.Maybe this?
Comment #6
nikunj.shah commentedComment #7
solideogloria commentedSame as before, you don't need to check it twice. If it's empty
$bundlesis FALSE, if not, then TRUE. So the code will never check if!empty($bundles). You can just do one or the other.https://www.php.net/manual/en/function.empty.php
Comment #8
snehalgaikwad commentedKept only one condition to check if $bundles has value.
Comment #9
snehalgaikwad commentedRemoved count() and used empty() only for checking if variable is empty.
Comment #10
xorunaI applied the patch in #9 and it works for me, thanks.
Comment #11
solideogloria commentedI noticed the return statement is indented with 4 spaces in patch #9. I fixed it to be 2.
I also fixed the patch naming. Underscores are only for the module name, I think, otherwise it's unclear what the module name is at a glance.
Comment #12
xorunaI applied your patch #11 on the last version of the module 1.7 and it works, thanks.
Maybe it could be checked and committed in a next release?
Comment #13
solideogloria commentedYep. Still applies and works. Hope this will get fixed in a release soon.