Ghost/core/server
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
..
adapters Reworked LocalFileStore methods to use async syntax 2021-10-20 10:29:46 +04:00
api Moved URL service to backend 2021-10-19 07:29:09 +13:00
data Updated Offers related tables (#13609) 2021-10-20 14:22:37 +02:00
lib Refactored tpl to never be used in DI 2021-10-11 15:19:54 +01:00
models 🐛 Fixed URLs not being correctly transformed during insert operations (#13618) 2021-10-20 15:22:46 +01:00
services Fixed custom theme settings being clobbered with duplicate-named themes 2021-10-20 13:25:02 +01:00
views Added new, simpler, linear boot process 2021-02-08 11:56:44 +00:00
web Renamed bootstrap to routerManager 2021-10-19 07:29:09 +13:00
analytics-events.js Added comments to all usages of lib/common/events 2021-07-07 16:02:44 +01:00
ghost-server.js Switch to @tryghost/debug, remove ghost-ignition 2021-06-15 17:24:22 +01:00
notify.js Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
overrides.js Set global Luxon timezone override to UTC 2021-10-20 09:19:29 +02:00
run-update-check.js Removed remaining usage of i18n & translation file 2021-10-15 11:39:07 +01:00
update-check.js Fixed critical alerts sending to admin users 2021-07-07 11:29:18 +04:00