Giter Site home page Giter Site logo

grav-plugin-sqlite's People

Contributors

finanalyst avatar hughbris avatar marshmn avatar nicohood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grav-plugin-sqlite's Issues

Runtime errors with extra_security enabled

I'm experiencing runtime errors ("Crikey!") in two slightly different situations which I suspect may be solved in a single change to the codebase.

The error is: "Undefined property: stdClass::$sqliteSelect" and is being thrown at line 71 of sqlite.php.

In both cases, I have extra_security enabled and the errors do not happen when it is disabled,

  1. Any page which does not have a sqliteSelect header will generate this error when extra_security is on. It can be reproduced simply by toggling those two headers in the page and in the plugin config respectively. This is a problem because the header has no other possible listed value, although if I change it to an arbitrary value ("foo") the error does not happen.
  2. It also happens when restricting the page visibility using a header via the login plugin (as per Create a private area). It happens whether or not sqliteSelect is provided on the page. I think this is because the page is redirected and the login page does not have this header (as per the first case above). Presumably, this will happen wherever Grav redirects are in effect.

I am pretty sure both causes can be circumvented simply by testing for the header's existence in line #71 before testing its value. However, there may be a better way to exclude redirected pages from executing this code at all.

I am happy to provide a basic patch if you don't have time to fix this promptly, as it may hold me up otherwise. Just thought I'd better give you the chance to handle the redirect scenario more elegantly if you know a way :) Let me know.

Deletes Pages

After GPM-installation all pages were deleted and new pages made were imediatelly deleted too.

is this plugin abandoned?

Hi, I don't particularly want to take this plugin over, but it's been some time since the owner @finanalyst has responded to some issues or my PR, so I need to politely check if it is being maintained in accordance with the Abandoned Resource Protocol.

I have several other improvements in local branches I'd also like to have considered for official integration.

Really appreciating the plugin, BTW :) Thank you for building it.

Cheers

Allow admins to completely disable shortcode queries

This plugin allows us to disable [sql-table] shortcode select queries per page or to globally enable them.

Since editors can edit page headers, it would be nice to prevent them from running queries at all from page markdown.

I don't think it's a gaping security problem (as long as you trust your editors), but it seems a logical extension to the settings already available.

Shortcode 'id' parameter not working

Setting the id parameter on the shortcode is not working.

e.g.

[sql-table id=foo]
...
[/sql-table]

The above should result in setting the id attribute on the table to foo - but instead no id attribute is present in the output.

Stopping redirects?

Im wondering if there is a way to submit the form, without redirecting to a new page?
I think it would require an ajax submit, and "preventDefault" call within a function. Ive tried a few ways so far, but if there are any suggestions how this could be done (if it can) that would be great.
Im thinking of adding a page variable that would control this (I think this would be most useful).

Request

Nice plugin and great possibilities!!
Is it possible to extend the documentation with an example Form Action sql-select (create a form which will generate a SELECT statement, based on values from the form and displaying the result of this SELECT)?
Thnx!

How to list rows from table in HTML and edit any one of them without hardcoding ID in SQL?

Hello,

I would like to ask you if it's possible to fetch all table rows and list them on a page by somehow looping trough them, and when we press button "Edit" on any of those items, to get correct row by it's ID to be changed? If so, how can I accomplish that? ๐Ÿ’ฏ ๐Ÿ‘ :)

It yould be a pretty nice small alternative to some web app functionalities..

Thank you!

Multiple Forms

The forms plugin has a multiple forms format.
I have been trying to use this format with this plugin with no success - is there a specific way to do this?
Does it support multiple forms in the blueprint?
Thanks in advance.

Grav skeleton

Hello,

I would like to ask you to make a simple skeleton which utilizes SQLite plugin as an example, or an explanation as to how to edit specific table row.

For example,

a table in which every row has edit button, and when it is pressed it opens corresponding row according to it's id(row-id?) to be edited.

Thank You in advance!

Front Matter and Site Variables not recognized

Hi,
Thank you for the plugin which is very useful to bridge a lot of gaps!
I am having an issue though.
NB. I am using the chinook database which is provided as a test database by SQLite
I am trying to include a front matter variable in the stanza, so that I may have a different one for each page.
Here is the code for the page:

---
title: 'Test Database'
template: places
database:
    query: "Smith"
shortcode-core:
    active: true
cache-enabled: false
process:
    twig: true
---
Query String: <strong>{{page.header.database.query}}</strong>

[sql-table]
SELECT  trackid, name, composer, milliseconds FROM tracks WHERE composer LIKE "{{page.header.database.query}}" ORDER BY trackid ASC LIMIT 10;
[/sql-table]

The outcome is that the query string Smith is well recognized on the page but is NOT within the stanza: it is left empty there. As a result the SQL query is executed on an empty string instead of Smith and yields no result. Have a look at the attached screenshot.
20190227_10-03-38

Please help.
Best,
Stephen

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.