Skip to content

Code style errors in Functions.php #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jcogs-design opened this issue Jun 4, 2020 · 1 comment · Fixed by #3393
Closed

Code style errors in Functions.php #442

jcogs-design opened this issue Jun 4, 2020 · 1 comment · Fixed by #3393
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@jcogs-design
Copy link
Contributor

jcogs-design commented Jun 4, 2020

Description of the problem
While working on #441 I noticed two coding errors flagged up in public function prep_conditionals which is found elsewhere in the Functions.php code.

The first is an attempt to merge a string variable into an array value:

$vars = array_merge($vars, ee()->TMPL->embed_vars);

The second is an attempt to return a value ($prepped_string) that is not defined

Both appear to be code that hasn't been touched in over 6 years, so presumably neither are causing problems, but maybe should be fixed at some point.

How To Reproduce
Errors are in the code.

Error Messages
n/a

Screenshots / Videos / Template Code
n/a

Environment Details:

  • Version: [5.3.2]

Possible Solution
I'm not sure what use is made of this function. A decision on how to proceed depends on knowing whether it is used, and what actual function is required from these two lines of code. Once this established, fix should be apparent.

Additional context

@intoeetive intoeetive added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Oct 9, 2020
@intoeetive
Copy link
Contributor

intoeetive commented Oct 9, 2020

For 1st one, looking at function calls I think both variables are arrays, but $vars is mistakenly desribed as string in function's comment.
2nd one is not really an issue because the code execution never gets there. It likely needs to be removed however.

So the fix would really be more "cosmetical" type of thing, this is not code error as such

@intoeetive intoeetive changed the title Apparent code errors in Functions.php Code style errors in Functions.php Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants