Wappler adds space in php code

Looks like this bug hasn’t been fixed:

When having “Format document on save” activated and code like this on the page:

<meta property="og:site_name" content="<?php echo($rsMetaWebsite->getColumnVal("WebsiteTitel_de")); ?>">

Wappler adds a space: … getColumnVal(" WebsiteTitel_de") …

<meta property="og:site_name" content="<?php echo($rsMetaWebsite->getColumnVal(" WebsiteTitel_de")); ?>">

and breaks the code for the page. In this case the page won’t be indexed correctly by Google.

I will update the save that it doesn’t format PHP pages. The formatter from monaco is for HTML and seems to have some problems with the embedded PHP code. For now it is best to disable the formatting until we find a better formatter which will support PHP code.

2 Likes

Will this just be for format on save (rather than formatting manually)? I don’t use the ‘on save’ option but I use the formatter frequently and it seems to work very well, at least with v3.9.9.

Yes, I will only prevent the formatting on save, you can still use the format document option within the code editor.

1 Like

This has been fixed in Wappler 4.0.3

1 Like

This topic was automatically closed after 25 hours. New replies are no longer allowed.