smooth-code / smooth.js

Code driven CMS powered by GraphQL & React.
MIT License
26 stars 10 forks source link

fix(graphql): Cannot read property '0' of undefined #45

Closed philibea closed 4 years ago

philibea commented 4 years ago

In case you use WPLM plugins in wordpress. If you start with a page Fench then a page translated into English but must remain in draft (the page does not contain slug). So we come across a graphql bug related to the error: TypeError: Can not read property '0' of undefined at Object.getContent (/../node_modules/smooth-backend-wordpress/lib/acf/api.js:113:18) at processTicksAndRejections (internal / process / task_queues.js: 93: 5) at async Promise.all (index 0)

Or data should always be an array.

gregberge commented 4 years ago

@philibea can you rebase, I will merge it!

philibea commented 4 years ago

@neoziro can we merge this pr ?

gregberge commented 4 years ago

Changes: