Giter Site home page Giter Site logo

Comments (9)

angrybrad avatar angrybrad commented on June 16, 2024 1

@slemont3

Could that affect/limit the preview functionality of unpublished pages?

Nah - licensing issues wonโ€™t affect site functionality.

Any chance we could get some Craft control panel and SSH access to that box to poke around a bit? If so, could you send the details over to [email protected] and reference this issue?

from cms.

slemont3 avatar slemont3 commented on June 16, 2024 1

Hi all

A quick update from my side that the issue all of sudden was resolved and previewing draft or deactivated pages works as expected. Alas, we cannot really comprehend what might have changed by now on our Google Cloud Craft instance. We'll gladly report back if the issue appears again and if we know how to solve it.

from cms.

angrybrad avatar angrybrad commented on June 16, 2024

@slemont3 is it a Cratt-styled 404 response or an nginx/apache styled 404?

Are you accessing the control panel through site.com/admin and the front-end of the site is site.com? Or is control panel access subdomain-based? i.e. cp.site.com and the front-end is site.com

from cms.

slemont3 avatar slemont3 commented on June 16, 2024

Hi @angrybrad , thanks for getting back at this!

It's a Craft-styled 404 response. And the control panel is accessed normally without a subdomain, so for example site.com/admin and the preview url would be: https://site.com/testpage?x-craft-preview=xxx&craft-token=xxxxxxx

Note that the tokenParam config is set to 'craft-token' as we have to use the 'token' query parameter for something else.

from cms.

slemont3 avatar slemont3 commented on June 16, 2024

In addition to the above, we are currently getting the info that our Craft CMS license is invalid since our license is still being used on the live web server we're migrating the website from. Could that affect/limit the preview functionality of unpublished pages?

from cms.

Envaya avatar Envaya commented on June 16, 2024

Struggling with the very same issue

from cms.

brandonkelly avatar brandonkelly commented on June 16, 2024

@Envaya Also on Google Cloud?

from cms.

MilanDeruelle avatar MilanDeruelle commented on June 16, 2024

Not sure if this is related, but I am currently also having an issue with previews: My previous projects used a simple entry query with the x-craft-token set. Now, I need to set "drafts: null" in order to get data for the drafts; e.g.

preview: entry(site: $site, uri: $uri, drafts: null) {
          title
          uri
}

Is it possible something did break/change from previous version of 4 to 4.9.5?

from cms.

brandonkelly avatar brandonkelly commented on June 16, 2024

@MilanDeruelle Just tested on 4.9.5 and it worked fine.

I have a preview target set to the URL format graphql-test?entryId={canonicalId}, and a graphql-test.twig template with:

<html>
<head>
  <title>GraphQL Test</title>
</head>
<body>

{% set entryId = craft.app.request.getQueryParam('entryId') %}
{% set token = craft.app.request.getQueryParam('token') %}

<script type="module" async>
  const entryId = {{ entryId|json_encode|raw }};
  const token = {{ token|json_encode|raw }};
  const response = await fetch('/api', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/graphql',
      'X-Craft-Token': token,
    },
    body: `query {
             entry(id: ${entryId}) {
               title
             }
           }`
  });
  const json = await response.json();
  document.write(`<p>${json.data.entry.title}</p>`);
</script>

</body>
</html>

This is using the public schema, which Iโ€™ve configured to include all entry queries, but not drafts, revisions, or non-live elements.

from cms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.