Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly Bug with v2.39.2 #340

Open
egonzalezg9 opened this issue Jun 21, 2021 · 2 comments
Open

Assembly Bug with v2.39.2 #340

egonzalezg9 opened this issue Jun 21, 2021 · 2 comments
Assignees
Labels

Comments

@egonzalezg9
Copy link

Version 2.39.2 of workflow causes assembly to crash when creating new sites that utilize apostrophe-headless. All you need to do to reproduce is use version 2.39.2 and have a theme with the following apostrophe-headless configurations:

    'apostrophe-headless': {
      cors: {
        origin: 'http://localhost:4000'
      }
    },
@abea
Copy link
Contributor

abea commented Jun 24, 2021

I found this as well. The problem is here: https://github.com/apostrophecms/apostrophe-workflow/blob/c4c3e2d72f799a78e48415259d985555ea8a9e22/lib/modules/apostrophe-workflow-pages/index.js#L35-L40

The self.modulesReady function does not return anything and doesn't run the callback so when Headless also improves the pages module and uses a self.modulesReady method it can't run.

@abea
Copy link
Contributor

abea commented Jun 24, 2021

I think it should be changed to something like this:

    const superModulesReady = self.modulesReady;
    self.modulesReady = function(callback) {
      return superModulesReady(function(err) {
        if (err) {
          console.error(err);
        }

        self.autoCommitPageMoves = self.apos.modules['apostrophe-workflow']
          .options.autoCommitPageMoves || false;
        return callback(null);
      });

    };

I haven't tested that much yet other than confirming a broken site can run with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants