Can 'Publish to' default to the active target?

I want to start using the new publish feature but I keep having to wait for it to fetch changes because I forget to change the ‘Publish to’ to be my localhost instead of the FTP server. If I’m working on the local target, can the target for publishing default to that instead?

Well usually you want to publish just to remote targets. There is no need to publish to local target, the files are already there…

Not necessarily. I have them stored where Wappler saves them but I run a localhost which I publish to. And there are times when I might have more than one localhost site if I’m staging something so having it default to the active target would still make sense.

Or, make it an option?

My staging target is on my remote server now.

Several times I’ve almost published my live site when I meant to publish to the staging server.

If you could at least make this an option it would be most appreciated.

Would setting your Production server as ‘development’ in your project settings work? And set your staging server as production? Then in that case it would always be your staging server by default. You would actually have to select your production server to push live. It’s still a single selection same as changing targets and would prevent accidentally pushing live. Just a thought. :wink:

Good idea. Thanks.

1 Like

Can I bump this request? I’ve been caught out by working on a staging target and then publishing to that target. But twice now I’ve accidently published to the production target because, despite me having Staging set in my targets, the dialog window for publishing defaults to the first target which, in my case, is the production one.

Can this not default to the current active target instead?

I am working on a project using a staging server and I needed to re-republish everything and it did it all to the live site which I didn’t initially notice. I had to restore a backup on the server as the live site broke as a result.

So having the default target set to the active target is very important to avoid this happening.

Or, have no target set at all and we have to select one. The problem is having a default target set which might not be the one we want to use.