Can't Save PHP Include pages

Wappler Version : 7.7.5
Operating System : MacOS
Server Model: PHP
Database Type: MySQL
Hosting Type: N/A

Expected behavior

What do you think should happen?

Should be able to make changes to a PHP include file and save the file.

Actual behavior

What actually happens?

Nothing happens when using keyboard shortcuts, or task bar menu on save. Impossible to save include files.

How to reproduce

Make an edit to any include file and try to save.

What kind of include is that, is it a partial? Is the experimental routing option enabled?

Just a standard PHP include. Nothing fancy. Seems it only effects includes that have navbars. None of my header includes are savable. But other includes are. Here is some sample code that does not save. Experimental is not turned on.

<!-- Wappler include head-page="../home.php" appconnect="local" is="dmx-app" fontawesome_5="cdn" bootstrap5="local" components="{dmxBootstrap5Navigation:{},dmxBrowser:{}}" id="Sandbox" -->

<div is="dmx-browser" id="browserLogout"></div>
<dmx-serverconnect id="logout" url="/dmxConnect/api/authentication/logout.php" noload="true" dmx-on:success="browserLogout.goto('../')"></dmx-serverconnect>
<dmx-serverconnect id="userDetails" url="/dmxConnect/api/authentication/user.php"></dmx-serverconnect>
<div class="container bg-success">
    <div class="row">
        <div class="col">
            <nav class="navbar navbar-expand-lg text-bg-success">
                <a class="navbar-brand ms-auto text-light" href="../home">Brad's Tech Sandbox</a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar1_collapse" aria-controls="navbar1_collapse" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse text-light" id="navbar1_collapse">
                    <div class="navbar-nav text-light">
                        <a class="nav-item nav-link active text-light" href="../home">Home</a>
                        <div class="nav-item dropdown">
                            <a class="nav-link dropdown-toggle text-light" data-bs-toggle="dropdown" href="#" id="dropdown1" role="button" aria-haspopup="true" aria-expanded="false">Projects</a>
                            <div class="dropdown-menu" aria-labelledby="dropdown1">
                                <a class="dropdown-item" href="../proj_sms">SMS Text Messaging</a>
                                <!--<a class="dropdown-item" href="#">Another action</a>
    <a class="dropdown-item" href="#">Something else here</a>-->
                            </div>
                        </div>
                        <!--<a class="nav-item nav-link" href="#">About</a>
                            <a class="nav-item nav-link" href="#">Contact</a>-->
                    </div>
                </div>
            </nav>
        </div>
    </div>
</div>
<div class="container mt-3">
    <div class="row">
        <div class="col">
            <h5><small><a href="javascript:void(0);" class="btn btn-sm btn-success" dmx-on:click="logout.load({})"><i class="fas fa-sign-out-alt">&nbsp;</i>Log Out</a></small> &nbsp;&nbsp;&nbsp;<i class="fas fa-user-shield"></i>&nbsp; {{userDetails.data.query.auth_name}}</h5>
        </div>
    </div>
    <hr>
</div>

I can confirm removing components="{dmxBootstrap5Navigation:{}}" from the code enables saving again. Include files without that save fine.

I see all paths are relative to your head page, try making them absolute from your web root so see if that helps

How do I do that? And why would includes without the navigation component save just fine?

<!-- Wappler include head-page="../index.php" appConnect="local" is="dmx-app" bootstrap5="local" fontawesome_5="cdn" -->

The above works just fine.

Simply make the nav links start with a / instead of ../

I can't change my nav links because I can't save the file?

That is what we’re asking - change all the links to root relative and try saving the file :slight_smile:

Tried that. Won't save. Any file that has the components="" in it won't save.

If I remove the compnonets attribute from the header comment code it saves no problem. Specifically, navigation and browser components. Just formatter component seems to work fine.

Try changing the head-page url from head-page="../home.php" to head-page="/home.php" this should fix your issue.
We will check this problem and fix it.

1 Like

Yes, that fixes it. Thank you.