Ghost/core
Kevin Ansfield 256f16a01f
🐛 Fixed URLs not being correctly transformed during insert operations (#13618)
closes https://github.com/TryGhost/Team/issues/1150

Our override of the base Bookshelf `insert` operation so that our own `formatOnWrite()` method is called on attributes was working on a false assumption that an `attrs` attribute is passed in as it is for the `update` operation. Instead Bookshelf's base update uses the `model.attributes` values to create an `attrs` object that is then passed through the usual `.format()` method meaning that our `insert` override was not actually doing anything.

- added a failing regression test for the `formatOnWrite()` override behaviour
- adjusted our insert/update overrides to set an internal `_isWriting` property on the model, then if that property is true our `.format()` override (which is called by Bookshelf on a generated `attrs` object during inserts) we manually call our `.formatOnWrite()` method
  - updated both overrides even though `update` was working for consistency and less cognitive overhead for reasoning between two different approaches
2021-10-20 15:22:46 +01:00
..
client@4f3fd61cb3 Updated Admin to v4.19.1 2021-10-18 14:09:17 +01:00
frontend Clened up routing module API from unused exports 2021-10-19 07:29:09 +13:00
server 🐛 Fixed URLs not being correctly transformed during insert operations (#13618) 2021-10-20 15:22:46 +01:00
shared Moved public folder to frontend 2021-10-16 19:27:34 +01:00
app.js Added Sentry to new boot process 2021-02-19 09:20:41 +00:00
boot.js Renamed bootstrap to routerManager 2021-10-19 07:29:09 +13:00
bridge.js Renamed bootstrap to routerManager 2021-10-19 07:29:09 +13:00