New content-type fields for users-permissions.user aren't preserved

Update 3. I suspected that one of the recent Strapi updates introduced breaking changes. Maybe one of https://github.com/strapi/strapi/pull/16333 or chore: remove history & clean up some U&P tests by joshuaellis · Pull Request #16992 · strapi/strapi · GitHub

To test this theory, I decided to run some tests using every version inbetween where I started and where I’m now. When I found a version that no longer worked, I’d know which update broke things.

I didn’t get very far. I realized that even the working version I came from, v4.9.0 had the same error I demonstrated in my original post. This led me to believe that there was something I missed in my custom users-permissions extension. Some of the code I had running in production was not the same as what I was working with in my development environment.

My custom extensions are summarized in another thread, How to allow content access for only Patrons

What I was missing in my development environment was my custom strapi-server.js, which overwrites providers and providers-registry. Without this file, I was overwriting everything with the stock users-permissions strapi-server.js, which introduced the initially described strange behavior.

'use strict';
// src/extensions/users-permissions/strapi-server.js
module.exports = (plugin) => {
    plugin.bootstrap = require('./server/bootstrap');
    plugin.services['providers'] = require('./server/services/providers');
    plugin.services['providers-registry'] = require('./server/services/providers-registry');
    return plugin;
}

I’m up and running with a content type manager that behaves as expected.

1 Like