Jump to content

[SOLVED] JavaScript error - 'invalid json in alfred' but I'm not outputting any json to the block


FireWire
 Share

Recommended Posts

First time I've run into this. I have a block called "Quote" and I've used it on one template but started getting this error when using it on a different template.

image.png.33c219ea3d8b6ee388d1682fcaea6d10.png

I removed all of my block markup but still getting the error.

image.png.743fc237599ca75acba326adbffd446a.png

It looks like the {alfred($block)} call is inserting JSON into the element

image.thumb.png.6da06aa4735600e09eca64a7c98ec189.png

I feel like there's something I'm missing but can't figure out what would be causing it and not sure where to start looking.

 

Link to comment
Share on other sites

Hey @FireWire the error does not come from block markup, it comes from the {alfred()} call, as the error message tells.

Alfred needs a json to get all block settings and it should look like this in the source code (don't use the devtools here):

uUyTewe.png

Also look into the console - it should log the element with the wrong alfred json. Once we know the json we can see how to fix it.

  • Thanks 1
Link to comment
Share on other sites

That's the screenshot I forgot to include 🤦‍♂️

image.thumb.png.0f9b09664e0a536879ed86834b98f0cf.png

From what I can tell it's saying that the section tag itself is the cause?

@bernhard I forgot to tag you 🤦‍♂️ (this emoji is getting a lot of use these days...)

Link to comment
Share on other sites

@bernhard 

<section class="rpb-quote page-section rpb-block"  data-rpbblock=5827 alfred='{&quot;icons&quot;:[{&quot;icon&quot;:&quot;edit&quot;,&quot;tooltip&quot;:&quot;Edit Block #5827&quot;,&quot;href&quot;:&quot;\/admin\/page\/edit\/?id=5827&amp;language=1027&quot;,&quot;class&quot;:&quot;pw-modal alfred-edit&quot;,&quot;suffix&quot;:&quot;data-buttons=\&quot;button.ui-button[type=submit]\&quot; data-autoclose data-reload&quot;},{&quot;icon&quot;:&quot;clone&quot;,&quot;label&quot;:&quot;&quot;Five International Architecture Festivals Worth Building a Trip Around&quot;&quot;,&quot;tooltip&quot;:&quot;Clone Block #5827&quot;,&quot;href&quot;:&quot;\/admin\/rockpagebuilder\/clone\/?block=5827&quot;,&quot;confirm&quot;:&quot;Do you really want to clone this element?&quot;},{&quot;icon&quot;:&quot;moveh&quot;,&quot;label&quot;:&quot;&quot;Five International Architecture Festivals Worth Building a Trip Around&quot;&quot;,&quot;tooltip&quot;:&quot;Move Block #5827&quot;,&quot;class&quot;:&quot;pw-modal&quot;,&quot;href&quot;:&quot;\/admin\/page\/edit\/?id=1&amp;language=1027&amp;field=rockpagebuilder_blocks&amp;rpb-moveblock=5827&quot;,&quot;suffix&quot;:&quot;data-buttons=\&quot;button.ui-button[type=submit]\&quot; data-autoclose data-reload&quot;},{&quot;icon&quot;:&quot;trash-2&quot;,&quot;label&quot;:&quot;&quot;Five International Architecture Festivals Worth Building a Trip Around&quot;&quot;,&quot;tooltip&quot;:&quot;Trash Block #5827&quot;,&quot;href&quot;:&quot;\/admin\/rockpagebuilder\/trash\/?block=5827&quot;,&quot;confirm&quot;:&quot;Do you really want to delete this element?&quot;},{&quot;icon&quot;:&quot;code&quot;,&quot;label&quot;:&quot;\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.latte&quot;,&quot;href&quot;:&quot;subl:\/\/open\/?url=file:\/\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.latte&amp;line=%line&quot;,&quot;tooltip&quot;:&quot;\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.latte&quot;},{&quot;icon&quot;:&quot;php&quot;,&quot;label&quot;:&quot;\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.php&quot;,&quot;href&quot;:&quot;subl:\/\/open\/?url=file:\/\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.php&amp;line=%line&quot;,&quot;tooltip&quot;:&quot;\/home\/modernismweek\/public_html\/site\/templates\/RockPageBuilder\/blocks\/Quote\/Quote.php&quot;}],&quot;addTop&quot;:&quot;\/admin\/rockpagebuilder\/add\/?block=5827&amp;above=1&quot;,&quot;addBottom&quot;:&quot;\/admin\/rockpagebuilder\/add\/?block=5827&quot;,&quot;addLeft&quot;:null,&quot;addRight&quot;:null,&quot;widgetStyle&quot;:false,&quot;type&quot;:&quot;Quote&quot;}'>
  <div class="pt-4 px-5 md:px-10 lg:px-16">
    <blockquote class="relative w-fit max-w-[60rem] mx-auto">
      <span class="block absolute top-0 left-0 w-20 h-20 text-neutral-100 transform -translate-x-8 -translate-y-8 child-svg:w-full child-svg:fill-neutral-200">
        <?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16" aria-hidden="true" role="img" aria-labelledby="title-bc232395-adec-49ef-877a-a8c1d379b1d1"><title id="title-bc232395-adec-49ef-877a-a8c1d379b1d1">Open Quote</title><path d="M7.39762 10.3C7.39762 11.0733 7.14888 11.7 6.6514 12.18C6.15392 12.6333 5.52552 12.86 4.76621 12.86C3.84979 12.86 3.09047 12.5533 2.48825 11.94C1.91222 11.3266 1.62421 10.4467 1.62421 9.29999C1.62421 8.07332 1.96459 6.87332 2.64535 5.69999C3.35231 4.49999 4.33418 3.55332 5.59098 2.85999L6.4943 4.25999C5.81354 4.73999 5.26369 5.27332 4.84476 5.85999C4.45201 6.44666 4.19017 7.12666 4.05926 7.89999C4.29491 7.79332 4.56983 7.73999 4.88403 7.73999C5.61716 7.73999 6.21938 7.97999 6.69067 8.45999C7.16197 8.93999 7.39762 9.55333 7.39762 10.3ZM14.6242 10.3C14.6242 11.0733 14.3755 11.7 13.878 12.18C13.3805 12.6333 12.7521 12.86 11.9928 12.86C11.0764 12.86 10.3171 12.5533 9.71484 11.94C9.13881 11.3266 8.85079 10.4467 8.85079 9.29999C8.85079 8.07332 9.19117 6.87332 9.87194 5.69999C10.5789 4.49999 11.5608 3.55332 12.8176 2.85999L13.7209 4.25999C13.0401 4.73999 12.4903 5.27332 12.0713 5.85999C11.6786 6.44666 11.4168 7.12666 11.2858 7.89999C11.5215 7.79332 11.7964 7.73999 12.1106 7.73999C12.8437 7.73999 13.446 7.97999 13.9173 8.45999C14.3886 8.93999 14.6242 9.55333 14.6242 10.3Z" /></svg>
      </span>
      <div class="relative z-10 prose prose-neutral max-w-none">
        <em class="text-lg leading-relaxed tracking-wide sm:text-xl md:text-2xl"><div id=pw-edit-5 class='pw-edit pw-edit-InputfieldTextarea' data-name=rpbblock_textarea data-page=5827 data-lang='1027' style='position:relative'><div class=pw-edit-orig>One of the top five international architecture festivals in the world.</div><div class=pw-edit-copy id=pw-editor-rpbblock_textarea-5827 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>One of the top five international architecture festivals in the world.</div></div></em>
      </div>
      <footer class="mt-4 md:mt-6 pl-4 md:pl-10">
        <div class="flex items-center justify-center md:justify-start space-x-4">
          <div>
            <div class="text-base md:text-lg text-neutral-700"><span id=pw-edit-8 class='pw-edit pw-edit-InputfieldPageTitle' data-name=title data-page=5827 data-lang='1027' style='position:relative'><span class=pw-edit-orig>&quot;Five International Architecture Festivals Worth Building a Trip Around&quot;</span><span class=pw-edit-copy id=pw-editor-title-5827 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>"Five International Architecture Festivals Worth Building a Trip Around"</span></span></div>
            <div class="text-sm md:text-lg text-neutral-600 mt-2 pl-6">
              <a href="https://robbreport.com/shelter/spaces/five-international-architecture-festivals-1235458827/https://robbreport.com/shelter/spaces/five-international-architecture-festivals-1235458827/" class="!no-underline" rel="noopener nofollow" target="_blank">
                <span id=pw-edit-12 class='pw-edit pw-edit-InputfieldText' data-name=rpbblock_text data-page=5827 data-lang='1027' style='position:relative'><span class=pw-edit-orig>— Robb Report</span><span class=pw-edit-copy id=pw-editor-rpbblock_text-5827 style='display:none;-webkit-user-select:text;user-select:text;' contenteditable>— Robb Report</span></span>
              </a>
            </div>
          </div>
        </div>
      </footer>
    </blockquote>
  </div>
</section>

 

  • Thanks 1
Link to comment
Share on other sites

  • FireWire changed the title to [SOLVED] JavaScript error - 'invalid json in alfred' but I'm not outputting any json to the block

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
Ă—
Ă—
  • Create New...