Issue #1757Opened January 28, 2019by madcowtuning0 reactions

Remote storagemanager not working

Question

Hello,

For 2 days I am fighting with the storageManager. I couldn't load template from remote file. Finaly I discovered that it is working only when I load grapesjs from https://unpkg.com/grapesjs. If I triy to load grapesjs from any min.js or dev dist files remote template load is not working. It is also working with the grapes.min.js file from dev dist folder but only if I rename the file to grapes.js. If I try to load it as grapes.min.js it is not working.

Answers (3)

madcowtuningJanuary 30, 20190 reactions

I figured out what is going on. If you set contentTypeJson "true" the load is working but the store is not because it is trying to send json data as POST data and server didn't parse it. If you set contentTypeJson "false" load is not working because it is in json format but then store is working. I modified grapes.min.js by removing 'this.get("contentTypeJson")&&' from onResponse function and setting contentTypeJson:!1 on both places in the file. Now everything works perfectly.

artfFebruary 6, 20190 reactions

server didn't parse it

The server should take the POST content from the body of the HTTP request

madcowtuningFebruary 6, 20190 reactions

I fixed it by modifying this row: var res = parsable ? JSON.parse(text) : text;

If I set contentTypeJson to false it couldn't load template because it is JSON type but can store the data. If I set contentTypeJson to true then it reads the template but then send POST data as json, php didn't parse it and I receive an empty POST. So I set it to false and modified the upper row so It always parse the template as JSON.

On Wed, Feb 6, 2019 at 2:00 AM Artur Arseniev [email protected] wrote:

server didn't parse it

The server should take the POST content from the body of the HTTP request

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artf/grapesjs/issues/1757#issuecomment-460853012, or mute the thread https://github.com/notifications/unsubscribe-auth/As8MgGqcih3yWxSeQurFlgZ9JC-lpMAXks5vKhsRgaJpZM4aWxH9 .

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.