You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On sites that use a customized composer.json, this file will be overwritten when ClassicPress is updated (manually or automatically). This is not the desired behavior as any dependencies will be lost.
We need to modify the update code to avoid overwriting composer.json. A couple of options:
Never overwrite composer.json
Detect whether composer.json has been modified and overwrite it if no customizations have been made
The text was updated successfully, but these errors were encountered:
invisnet
with #477, i remember we looked into that when including composer.json - did we miss something or just get it wrong?
James Nylen 12:37 AM
no, we looked into something different (what happens when migrating if composer.json already exists)
I don't think we really got that case right either
invisnet 12:38 AM
ah, that'd be it....
really goes back to the fundamental problem that it's in the wrong place
James Nylen 12:39 AM
composer wants to install from the repo where composer.json lives though, right? if that's the only way then there isn't really a better place to put it
invisnet 12:43 AM
there was a convo about subdirs etc iirc to solve that - not something for 1.x obvs
is there any existing logic for not overwriting files?
James Nylen 12:50 AM
I don't remember seeing anything like that.. the simplest fix would just be putting if ( $filename === 'composer.json' ) { continue; } in the right place
yeah, "if it doesn't exist, write it, otherwise leave it alone"
this works because composer.json (normally) doesn't change across releases
invisnet 12:54 AM
it'll change between v1 and v2 won't it?
nevermind - it'll change when johnpbloch/wordpress-core-installer changes as we've got a specific version in there
i think we need to change that to "^1.0"
James Nylen 1:04 AM
wfm
On sites that use a customized
composer.json
, this file will be overwritten when ClassicPress is updated (manually or automatically). This is not the desired behavior as any dependencies will be lost.We need to modify the update code to avoid overwriting
composer.json
. A couple of options:composer.json
composer.json
has been modified and overwrite it if no customizations have been madeThe text was updated successfully, but these errors were encountered: