Jump to content

FrontendForms - A module for creating and validating forms on the frontend


Juergen

Recommended Posts

This issue has nothing to do with the module itself, but it seems that the $_SERVER array is not loaded at that moment.

You can try the following: 

// Replace the following line inside the FrontendForms.module file on line 858

if (strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) {

with this line

if (!is_null($_SERVER) && strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) {

Let me know if it works

Link to comment
Share on other sites

This gives the same error.

I fill this is related with the module because this is not the first time I bootstrap PW and never had an issue before to install this module.

You are using REQUEST_URI, but when bootstrapping, isn't it expected that it's not defined?

It's easy to test, just include PW index.php in any script and run it directly (no web page involved).

Edited by da²
Link to comment
Share on other sites

Then try the following:

if (!is_null($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) {

Have not tried it with bootstrapping but the code inside the if condition is not important for running forms. It is only there to add CSS and JS files to the backend, so you can prevent the running of the code inside the condition by checking the existence of $_SERVER['REQUEST_URI'] first.

Link to comment
Share on other sites

On 8/30/2025 at 9:59 PM, Juergen said:
if (!is_null($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) {

This gives a warning, better like this:

if (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], $this->wire('config')->urls->admin) === 0) {

Will you publish a fix?

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...