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

PageParameter and Page Lava filters do not work in Lava-enabled Obsidian block settings #5671

Closed
2 tasks done
leahjennings opened this issue Nov 9, 2023 · 2 comments
Closed
2 tasks done
Labels
Fixed in v16.3 Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug Confirmed bugs or reports that are very likely to be bugs.

Comments

@leahjennings
Copy link
Collaborator

Description

We are heavily customizing the output of the projects in the Sign-Up Finder block. A lot of the information is powered by a persisted dataset. We need to show / hide certain projects based on a URL parameter that we can check against the persisted dataset. In setting all of this up, I found that the PageParameter and Page lava filters do not work in the Results Lava Template section of the Sign-Up Finder block. When you assign a variable to the contents of a page parameter, it is an empty string.

I think it's a bug because the Debug filter shows the page parameters like I would expect, as well as the PageParameter object.

In further testing, the filters do work correctly and output the expected value if used in an HTML Content block on the same page. So the issue seems to be isolated to the Results Lava Template of the Sign-Up Finder Obsidian block.
image

image

Actual Behavior

The PageParameter and Page lava filters do not return query string / parameter info. The assigned variable ends up being blank/empty.

Expected Behavior

I would expect to be able to use these filters to get a page parameter from a URL.

Steps to Reproduce

  • On the demo site, go to the /signups page
  • Edit the URL to add a page parameter (my edited URL looked like this: https://rock.rocksolidchurchdemo.com/signups?testingParameter=yes)
image
  • Edit the block and find the Lava Results Template section
  • Add this code to lines 2-7:
{% assign testingparameter = 'Global' | PageParameter:'testingParameter' %}
parameter: {{ testingparameter }}
<hr/>
{{ PageParameter | ToJSON }}
<hr/>
{{ 'Lava' | Debug }}
image
  • Click Save and load the page
  • Notice how the assigned variable, using the PageParameter filter, is empty but the Debug and PageParameter variable both have the correct information
image
  • Alternatively, I tried the Page filter and it also did not work
  • On the same block, edit the Lava Results Template again
  • Add this code to lines 3-8 (copied from the filter page)
{% assign queryParms = 'Global' | Page:'QueryString'  %}
Query Parms <br />
{% for item in queryParms %}
    {% assign kvItem = item | PropertyToKeyValue %}
    {{ kvItem.Key }}: {{ kvItem.Value }} <br />
{% endfor %}
image
  • Save the block
  • Notice how the parameter output is empty

Issue Confirmation

  • Perform a search on the Github Issues to see if your bug or enhancement is already reported.
  • Try to reproduce the problem on a fresh install or on the demo site.

Rock Version

Rock McKinley 15.1 (1.15.1.1), 16.0 (1.16.0.12)

Client Culture Setting

en-US

@sparkdevnetwork-service sparkdevnetwork-service added Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug Confirmed bugs or reports that are very likely to be bugs. labels Nov 13, 2023
@jasonhendee
Copy link
Contributor

jasonhendee commented Dec 7, 2023

Thanks, @leahjennings for another great write-up. Your level of detail and added screenshots make it very easy to reproduce most issues.

I found that this is an issue with Obsidian blocks as a whole, and not just the Sign-Ups Finder block in particular; I'm going to change the issue title to reflect this. Here's an example where I've placed a Legacy HTML Content block + Obsidian Group Schedule Toolbox block on a page. Adding your Lava snippets from above to each of these blocks produces the same outcome you've described.

Reproduce GitHub Issue 5671

@jasonhendee jasonhendee changed the title PageParameter and Page lava filters do not work in the Results Lava Template setting of the Sign-Up Finder block PageParameter and Page Lava filters do not work in Lava-enabled Obsidian block settings Dec 7, 2023
@sparkdevnetwork-service sparkdevnetwork-service added the Status: In Dev Queue This issue is being worked on, and has someone assigned. label Dec 11, 2023
@jasonhendee
Copy link
Contributor

@leahjennings in order to leverage this bug fix, you'll also need to make sure you've switched over to use the Fluid engine, as the fix is not able to be easily ported back to the DotLiquid engine.

@sparkdevnetwork-service sparkdevnetwork-service removed the Status: In Dev Queue This issue is being worked on, and has someone assigned. label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in v16.3 Status: Confirmed It's clear what the subject of the issue is about, and what the resolution should be. Type: Bug Confirmed bugs or reports that are very likely to be bugs.
Projects
None yet
Development

No branches or pull requests

3 participants