impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
345 stars 191 forks source link

Missing template conditional-visibility-attribute.html.php #6066

Closed flack closed 3 years ago

flack commented 3 years ago

User Story

I have been installing the latest 2.16.0 release locally and am now getting a PHP error

Details

The error is

Warning: include(wp-content/plugins/give/src/Form/LegacyConsumer/templates/conditional-visibility-attribute.html.php): Failed to open stream: No such file or directory in wp-content/plugins/give/src/Form/LegacyConsumer/templates/checkbox.html.php on line 34

So it comes from this line:

https://github.com/impress-org/givewp/blob/06a6306e9a140d3ee9facd047dca840c1b3074e2/src/Form/LegacyConsumer/templates/checkbox.html.php#L34

and it's true, the file is missing in the repo:

https://github.com/impress-org/givewp/tree/develop/src/Form/LegacyConsumer/templates

Expected Behavior

The missing template file should be added to the repo (or otherwise the include should be removed)

Steps to Reproduce

I can't exactly say, but looking at the code, it seems to happen when $field->hasOptions() returns false

JasonTheAdams commented 3 years ago

We'll look into this. Thank you for reporting, @flack!

ravinderk commented 3 years ago

@JasonTheAdams This is code left unchanged which refactor code. Previously visibility conditions were stored in the input field but now there stored in the input field container: https://github.com/impress-org/givewp/pull/6024

Removing this line of code will resolve the issue.