GithubHelp home page GithubHelp logo

owldesign / qarr Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 5.0 8.54 MB

Grow your business by allowing visitors to leave reviews or ask a questions.

Home Page: https://qarr.tools

License: Other

PHP 49.86% HTML 1.94% CSS 9.95% Twig 23.26% JavaScript 14.99%

qarr's Introduction

Hi there ๐Ÿ‘‹

qarr's People

Contributors

billmn avatar francoislevesque avatar owldesign avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

qarr's Issues

Ajax and callbacks

Is there a way to reinitialize when a site is ajaxified? Using SWUP (similar to BarbaJS) and am not sure how to reinit the scripts. Will find a workaround for now.

Can't install the plugin

Hi there,
When I try to install the plugin I got the next error:

2019-03-23 05:47:23 [-][1][-][error][craft\db\MigrationManager::migrateUp] Failed to apply Install (time: 0.760s). Output:
    > create table {{%qarr_reviews}} ... done (time: 0.047s)
    > create table {{%qarr_reviews_replies}} ... done (time: 0.028s)
    > create table {{%qarr_questions}} ... done (time: 0.031s)
    > create table {{%qarr_questions_answers}} ... done (time: 0.032s)
    > create table {{%qarr_questions_answers_comments}} ... done (time: 0.031s)
    > create table {{%qarr_displays}} ... done (time: 0.030s)
    > create table {{%qarr_correspondence}} ... done (time: 0.028s)
    > create table {{%qarr_correspondence_responses}} ... done (time: 0.028s)
    > create table {{%qarr_notes}} ... done (time: 0.029s)
    > create table {{%qarr_rules}} ... done (time: 0.029s)
    > create table {{%qarr_rules_elements}} ... done (time: 0.029s)
    > create index qarr_reviews_emailAddress_idx on {{%qarr_reviews}} (emailAddress) ... done (time: 0.042s)
    > create index qarr_reviews_status_idx on {{%qarr_reviews}} (status) ... done (time: 0.029s)
    > create index qarr_reviews_displayId_idx on {{%qarr_reviews}} (displayId) ... done (time: 0.030s)
    > create index qarr_reviews_productId_idx on {{%qarr_reviews}} (productId) ... done (time: 0.029s)
    > create index qarr_reviews_productTypeId_idx on {{%qarr_reviews}} (productTypeId) ... done (time: 0.029s)
    > create index qarr_questions_emailAddress_idx on {{%qarr_questions}} (emailAddress) ... done (time: 0.032s)
    > create index qarr_questions_status_idx on {{%qarr_questions}} (status) ... done (time: 0.030s)
    > create index qarr_questions_displayId_idx on {{%qarr_questions}} (displayId) ... done (time: 0.040s)
    > create index qarr_questions_productId_idx on {{%qarr_questions}} (productId) ... done (time: 0.031s)
    > create index qarr_questions_productTypeId_idx on {{%qarr_questions}} (productTypeId) ... done (time: 0.029s)
    > create index qarr_displays_name_idx on {{%qarr_displays}} (name) ... done (time: 0.033s)
    > create index qarr_displays_handle_idx on {{%qarr_displays}} (handle) ... done (time: 0.028s)
    > add foreign key qarr_reviews_productId_fk: {{%qarr_reviews}} (productId) references {{%commerce_products}} (id) ...Exception: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
The SQL being executed was: ALTER TABLE `qarr_reviews` ADD CONSTRAINT `qarr_reviews_productId_fk` FOREIGN KEY (`productId`) REFERENCES `commerce_products` (`id`) ON DELETE CASCADE (D:\server\craft3\vendor\yiisoft\yii2\db\Schema.php:664)

Craft CMS: 3.1.19
PHP: 7.2.10
Mysql: 5.7.24

Error viewing a newly created display

When creating a new Display and afterwards clicking that Display in the CP, this error is generated and I'm unable to view the Display page.

Argument 1 passed to craft\services\Sites::getSiteById() must be of the type int, string given, called in /Users/tom/Sites/jules-destrooper-dev/vendor/twig/twig/src/Extension/CoreExtension.php on line 1499

Craft: 3.17.1
QARR: 1.2.1

Error on Edit for Campaigns, Displays and Rules

When I try to edit a Display, Campaign or Rule this error was shown on CP:

Argument 1 passed to craft\services\Sites::getSiteById() must be of the type int, string given, called in /vendor/twig/twig/src/Extension/CoreExtension.php on line 1511

Probably related to: #28

I'm using:
Craft CMS 3.6.15
QARR version 1.2.7

Approving Questions or Answers gives 404 Error

Staging environment on Cloudways.

After a question is submitted from the frontend (works every time), on the backend trying to approved the question or approve an answer but they all return with this:

console log:

DevTools failed to load source map: Could not load content for https://phpstack-***-***.cloudwaysapps.com/cpresources/37b3c933/tippy/popper.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://phpstack-***-***.cloudwaysapps.com/cpresources/37b3c933/tippy/index.all.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
10196949:6 POST https://phpstack-***-***.cloudwaysapps.com/index.php?p=admin/actions/qarr/elements/update-status 404
nrWrapper @ 10196949:6
send @ jquery.js:10109
ajax @ jquery.js:9690
postActionRequest @ Craft.js:572
(anonymous) @ element-edit.js?v=1633658564:44
dispatch @ jquery.js:5430
v.handle @ jquery.js:5234
nrWrapper @ 10196949:6
10196949:6 POST https://phpstack-***-***.cloudwaysapps.com/index.php?p=admin/actions/qarr/elements/update-status 404
nrWrapper @ 10196949:6
send @ jquery.js:10109
ajax @ jquery.js:9690
postActionRequest @ Craft.js:572
(anonymous) @ element-edit.js?v=1633658564:44
dispatch @ jquery.js:5430
v.handle @ jquery.js:5234
nrWrapper @ 10196949:6
Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'.

craft ajax log error:

Stack trace:
#0 [internal function]: craft\controllers\TemplatesController->actionRender('actions/qarr/el...', Array)
#1 /home/***.cloudwaysapps.com/***/public_html/***/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#2 /home/***.cloudwaysapps.com/***/public_html/***/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#3 /home/***.cloudwaysapps.com/***/public_html/***/vendor/craftcms/cms/src/web/Controller.php(190): yii\base\Controller->runAction('render', Array)
#4 /home/***.cloudwaysapps.com/***/public_html/***/vendor/yiisoft/yii2/base/Module.php(534): craft\web\Controller->runAction('render', Array)
#5 /home/***.cloudwaysapps.com/***/public_html/***/vendor/craftcms/cms/src/web/Application.php(276): yii\base\Module->runAction('templates/rende...', Array)
#6 /home/***.cloudwaysapps.com/***/public_html/***/vendor/yiisoft/yii2/web/Application.php(104): craft\web\Application->runAction('templates/rende...', Array)
#7 /home/***.cloudwaysapps.com/***/public_html/***/vendor/craftcms/cms/src/web/Application.php(261): yii\web\Application->handleRequest(Object(craft\web\Request))
#8 /home/***.cloudwaysapps.com/***/public_html/***/vendor/yiisoft/yii2/base/Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /home/***.cloudwaysapps.com/***/public_html/***/web/index.php(21): yii\base\Application->run()
#10 {main}```

Author's name not showing up if it only has one word.

For some reason, the author's name isn't rendering on the frontend if the author only supplied a first name (one word) using {{ review.author }} or {{ question.author }}.

{{ review.fullName|split(' ')[0] }} and {{ question.fullName|split(' ')[0] }} works as a workaround.

Craft 4 Support

Hey just wanted to check in on support for Craft 4. We have a couple projects looking to use this plugin, and I'd like to be able to set expectations properly with clients regarding a timeline for support.

Thank you.

[Request] Non-jquery JavaScript functionality

Are there any plans on releasing a non-jquery version of this plugin?

If not, would it be possible to bundle or format the frontend to include jquery, as to not have to add that manually to the ?

Thanks!

Two errors when new questions are submitted

  1. When opening the dashboard:

A. Impossible to access an attribute ("title") on a null variable.
in owldesign/qarr/src/templates/dashboard/_includes/widget-recent.twig

B. Calling unknown method: owldesign\qarr\elements\Question::getFlags()
in owldesign/qarr/src/templates/dashboard/_includes/widget-recent.twig

  1. When opening a question page:

A. Impossible to access an attribute ("title") on a null variable.
in owldesign/qarr/src/templates/questions/_edit.twig

B. Impossible to invoke a method ("getCpEditUrl") on a null variable.
in owldesign/qarr/src/templates/questions/_edit.twig

etc...
They are probably in other templates

[Feature request]: Make the backend QARR module conform to the Craft CMS look

Right now, the control panel QARR section employs heavy use of nonstandard elements. It looks out of place when you compare it to other sections of the Craft CMS interface (entries, dashboard, settings, etc.). It would be nice if the QARR backend can use the standard Craft CMS design language so it will look coherent with the rest of the elements (red instead of the purple, standard fonts instead of the custom fonts). Really love this plugin!

[Feature request] Ability to Modify front-end templates.

Is there a way to modify the templates from within the /craft/templates folder, for example; if there's a _qarr folder in there?

Would be great if the plugin looked there first to determine if it should render the templates from craft/vendors/owldesign/qarr. The ability to override non-destructively (and end up losing the changes when updating the plugin), essentially.

Plugin breaks when products with reviews are disabled or deleted.

When discontinued products are removed from Craft Commerce, the review plugin breaks. Dashboards display incorrect numbers, and views that would have included the removed products give a server error and become non-respondant.

Reviews associated with products should be deleted OR they should be tackled to not rely on the product being within the CMS. We are currently stuck and the entire plugin is erroring with no way for us to fix it aside from manually clearing the database.

I was unable to find a support contact, aside from a slack link on the main QARR website that did not trigger when I clicked on it. Please let me know if there is a better way to contact someone.

Craft Version: Craft Pro 3.7.13
Plugin Version: 1.2.7
PHP Version: 7.4.20
Multisite: No

Getting QarrPlugin is not defined (ajaxified site)

I'm getting Uncaught ReferenceError: QarrPlugin is not defined when loading a page that doesn't have QARR loaded through {{ craft.qarr.display(model) }}, meaning trying to reinitialize QARR fails when navigating to a new page that has it, as the javascript for QARR isn't in the DOM. If I start on a page where it is included, then it works fine across the various pages.

Multiple Modals When Clicking "Review" or "Ask Question" Buttons

There seems to be multiple modals generated and added on top of each other when clicking the buttons to reveal modals ("Review" and "Ask Question"), sometimes two identical elements, sometimes more.

This also seems to break the modals submissions and inputs (for example, the stars don't change when clicking and then moving the mouse off, and submitting redirects back to the same url, but doesn't submit anything to be moderated).

The previous instance most likely needs to be destroyed/removed from the DOM when navigating through history, or clicking into other products and so forth.

Owl Carousel stops working

I am showing product reviews on product pages which is showing fine. Problem is that I am using "Owl Carousel" plugin to show carousel of product images which stops working now. Please help.

Error when approving/rejecting pending reviews from widget

We're using the latest version of the plugin(1.2.7) and getting status 500 when approving or rejecting a review in the admin. Here is the error message:

Argument 2 passed to owldesign\\qarr\\services\\Elements::queryElements() must be of the type string, null given, called in /home/vagrant/sites/mr-bear-family-v2/vendor/owldesign/qarr/src/controllers/ElementsController.php on line 26

Review does however get approved, so it still seems to work as expected(?), but we are also getting both a success message and an error message after clicking approve/reject on review.

Error message and success message

error when displaying the questions in the cp

I get an error when trying to open the edit page of a question in the cp
"Impossible to access an attribute ("id") on a null variable. in vendor\owldesign\qarr\src\templates\questions_edit.twig line 222"

Can't access QARR backend after updating

The error is: Impossible to access an attribute ("foodAndBeverage") on a null variable.

in /home/vagrant/code/testing/vendor/owldesign/qarr/src/templates/_elements/element-element.twig at line 4

Wrong status on index

When I update the status of a review (e.g. from "pending" to "approved") and return to the index, the table show the old status (even after a reload).

The only solution I found to solve the problem is to reset "Data caches" from the utility section.

Thoughts?

QARR: 1.3.2
Craft CMS: 3.7.52

How to prevent Spam

Our site is being bombarded with Spam Reviews. Users have to log in to post a review, so I think the spammer is bypassing the log in form & hitting the endpoint directly.

How can I prevent this ? Is there a hook I can use to check whether the user is logged in before saving the entry ?

Craft CMS 3.7.67
QARR 1.3.2

Email notification when review is posted

Hi there,

I'm not sure if I missed this, but after reviewing the docs and the issues list in Github I didn;t seem to find info for this feature.

I was wondering if it would be possible to get a notification email every time that a review gets posted? If this is already a feature could you please point me to the docs that I've missed? If is not, would you consider add it as a feature for the plugin?

Thanks, Alby.

[Feature Request] Verified Purchase

Not sure if it's worth it, but perhaps by checking the email associated with a submission against past orders emails could flip a switch. Or, is it possible to have a hidden field in a Display to incorporate this as a switch in the backend (for manual verification)?

[Breaking Bug] Getting HTTP 503 โ€“ Service Unavailable when posting review/question as guest (not logged in)

I'm back at testing and evaluating right now, and there seems to be an issue where the submitting a post throws a 503 - Service Unavailable error when the posting user is not a logged in user (guest, essentially).

Here's the stack trace;

craft\web\ServiceUnavailableHttpException in /Users/a/Sites/test/craft/vendor/craftcms/cms/src/web/Controller.php:163
Stack trace:
#0 /Users/a/Sites/test/craft/vendor/yiisoft/yii2/base/Controller.php(155): craft\web\Controller->beforeAction(Object(yii\base\InlineAction))
#1 /Users/a/Sites/test/craft/vendor/craftcms/cms/src/web/Controller.php(187): yii\base\Controller->runAction('save', Array)
#2 /Users/a/Sites/test/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('save', Array)
#3 /Users/a/Sites/test/craft/vendor/craftcms/cms/src/web/Application.php(299): yii\base\Module->runAction('qarr/reviews/sa...', Array)
#4 /Users/a/Sites/test/craft/vendor/craftcms/cms/src/web/Application.php(566): craft\web\Application->runAction('qarr/reviews/sa...', Array)
#5 /Users/a/Sites/test/craft/vendor/craftcms/cms/src/web/Application.php(278): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#6 /Users/a/Sites/test/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#7 /Users/a/Sites/test/web/index.php(21): yii\base\Application->run()

Feedback modal doesn't work

When you try to "Write a Review" on frontend occurs a 500 error because getClass Twig's filter doesn't exists.

After fixing the error by restoring the Twig extensions, I noticed that there are some javascript errors (eg Craft is not defined) that make the plugin unusable.

QARR breaks with Craft CMS 3.5

Error: Undefined class constant 'EVENT_AFTER_SAVE' in /Users/a/Site/craft/vendor/owldesign/qarr/src/QARR.php:108
Stack trace:
#0 /Users/a/Site/craft/vendor/yiisoft/yii2/base/BaseObject.php(109): owldesign\qarr\QARR->init()
#1 /Users/a/Site/craft/vendor/yiisoft/yii2/base/Module.php(158): yii\base\BaseObject->__construct(Array)
#2 /Users/a/Site/craft/vendor/craftcms/cms/src/base/Plugin.php(115): yii\base\Module->__construct('qarr', Object(craft\web\Application), Array)
#3 [internal function]: craft\base\Plugin->__construct('qarr', Object(craft\web\Application), Array)
#4 /Users/a/Site/craft/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)
#5 /Users/a/Site/craft/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('owldesign\\qarr\\...', Array, Array)
#6 /Users/a/Site/craft/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('owldesign\\qarr\\...', Array, Array)
#7 /Users/a/Site/craft/vendor/craftcms/cms/src/services/Plugins.php(908): yii\BaseYii::createObject(Array, Array)
#8 /Users/a/Site/craft/vendor/craftcms/cms/src/services/Plugins.php(227): craft\services\Plugins->createPlugin('qarr', Array)
#9 /Users/a/Site/craft/vendor/craftcms/cms/src/base/ApplicationTrait.php(1403): craft\services\Plugins->loadPlugins()
#10 /Users/a/Site/craft/vendor/craftcms/cms/src/web/Application.php(104): craft\web\Application->_postInit()
#11 /Users/a/Site/craft/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()
#12 /Users/a/Site/craft/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#13 /Users/a/Site/craft/vendor/craftcms/cms/src/web/Application.php(92): yii\base\Application->__construct(Array)
#14 [internal function]: craft\web\Application->__construct(Array)
#15 /Users/a/Site/craft/vendor/yiisoft/yii2/di/Container.php(400): ReflectionClass->newInstanceArgs(Array)
#16 /Users/a/Site/craft/vendor/yiisoft/yii2/di/Container.php(159): yii\di\Container->build('craft\\web\\Appli...', Array, Array)
#17 /Users/a/Site/craft/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\web\\Appli...', Array, Array)
#18 /Users/a/Site/craft/vendor/craftcms/cms/bootstrap/bootstrap.php(245): yii\BaseYii::createObject(Array)
#19 /Users/a/Site/craft/vendor/craftcms/cms/bootstrap/web.php(51): require('/Users/a/Sites/...')
#20 /Users/a/Site/web/index.php(20): require('/Users/a/Sites/...')
#21 /Users/a/.composer/vendor/laravel/valet/server.php(191): require('/Users/a/Site/...')
#22 {main}

Frontend: Review modal doesn't work

Hi @owldesign,
when I click on "Write a Review" on frontend I see these errors in console:

Schermata 2022-02-22 alle 16 11 08

These errors makes the plugin unusable as it is not possible to insert reviews.

Please can you help me?

[Feature request] Direct link to product review.

What do you think about the possibility of creating a direct link to post a review?

Essentially the inputs would be same as the modal for writing a review, with the potential to have some sort of hash or other url format that identifies the correct product being reviewed, and either pre-fills the name and email or hides those specific fields based on that. Preferably templatable, so that it's something that can be included among other stuff like product photography or a bespoke page build.

That link could then be sent via email and so forth, to verified customers, which would definitely ramp up the engagement on ecommerce sites.

[Feature request] File upload

It would be great to be able to include an assets field in the displays that can be used to upload images connected to a question or review. Not sure if or how this is doable within custom templates.

Average rating not reset after deleting reviews.

When I have reviews/ratings on an entry that were approved, when deleting them, the average rating is still calculated (as the reviews are still in the database I guess).

Clearing all soft deletes in Craft CMS through the terminal doesn't affect this at all.
The data is still in the qarr_reviews table and is still used.

Craft: 3.17.1
QARR: 1.2.1

Answer form returns a json

When i submit an answer form, the redirect url returns me a json response with "_successful-answer" template.
return $this->asJson(['success' => true, 'template' => $template ]);
setting the redirect url does not work. can you please check it
i set it to return to the old path but if i hit refresh, the form gets submitted again.

The Craft admin panel is affected by QARR css

It looks like there's some interference in the admin panel in some places like dropdown menus from the QARR resources.

Example;
Screen Shot 2019-06-04 at 11 38 01 PM

Possibly because the .qarr and .qarr-tools is being added to the <body> tag in the admin panel.

"Configure element" link has wrong url

On the reviews list in control panel, each review had a "configure element" link. I work on xampp localhost and my website url is http://localhost/site/web/.

Link URL is http://localhost/admin/qarr/settings/configuration, which omits site name from URL.

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.