soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

4.0 Beta 1: Dynamic Data - PHP Function Return Value uses empty string instead of default value #2759

Open dblomster opened 2 years ago

dblomster commented 2 years ago

Add this snippet: <?php function return_hello( $string = 'Hello' ) { return var_export( $string, true ); }

In the Oxygen Builder add e.g. a text element and choose Insert Data -> PHP Function Return Value and as Function Name enter "return_hello" and leave the Function Arguments field empty.

Expected output: 'Hello'

Actual output: ''

As mentioned in the title, Oxygen does not care about the default value in a function's first argument, instead the value is overwritten with an empty string.

KittenCodes commented 2 years ago

Thanks for the report. Replicated in v3 and reported internally.