Paywall plugin problems - .yml file configuration & permissions errors?
  • Hello, I'm experiencing problems installing the Paywall Plugin.

    I am trying to make a section (not an article/issue/publication) available to subscribers - the rest of the website should be open to visitors.



    a. Paywall admin backend - I have configured a new subscription called "Yearly", with the type "section" and period "365 days", price "49.99" and currency "EUR" ("Is Template?" says "no")

    b. Yml config - My application/configs/subscriptions/subscriptions.yml file has the following in it:

    subscriptions:
    specified_article: Yearly
    type: section
    range: 365
    price: 49.99
    currency: EUR
    specify:
    publication: 2
    issue: 50
    section: 400
    article:
    articles_from_publication:
    type:
    range:
    price:
    currency:
    specify:
    publication:
    article:
    type:
    range:
    price:
    currency:



    [I am not using Paypal so I have deleted the Paypal reference in your sample .yml file]



    c. Changes to article.tpl (Liquid theme)

    I have made the following changes to the article.tpl file (since the one for the liquid theme is different from the one for Quetzal which your example code is based on):



    {{ if $gimme->article->type_name=="page"}}

    {{ include file="page.tpl" }}


    {{ elseif $gimme->article->type_name == "debate" }}

    {{ include file="article-debate.tpl" }}

    {{else}}



    {{ include file="_tpl/_html-head.tpl" }}




    {{ include file="_tpl/header.tpl" }}






    {{ $subscription = $gimme->user->subscriptions->has_article($gimme->article->number) }}
    {{ if !$subscription || !$subscription->is_active }}
    {{ subscribe_form }}{{ /subscribe_form }}
    {{ else }}
    {{ include file="_tpl/article-cont.tpl" }}
    {{ /if }}


    {{ render file="_tpl/article_box-most_tabs.tpl" issue=off section=off cache=600 }}






    {{ include file="_tpl/footer.tpl" }}
    {{ include file="_tpl/_html-foot.tpl" }}

    {{/if}}


    d) I have also copied the sample templates in the _paywall folder to var/www//html/newscoop/themes/pulication_2/theme_1/_paywall



    e) Apache error log

    There are errors in the apache log file (could these be to do with permissions - since an attempt is being made to access cached files?!)

    [Sun Oct 16 05:15:54.794916 2016] [:error] [pid 31266] [client 141.101.99.63:9091] PHP Fatal error: Call to a member function has_article() on a non-object in /var/www/html/newscoop/cache/a35efac0ec87c29defe61fe68d5f954ee898a6da.file.article.tpl.php on line 71, referer: http://www.xxx.com/en/public/xxx_Magazine [NB THIS IS THE NAME OF THE SECTION I have specified in the .yml file]/
    [Sun Oct 16 05:28:43.424595 2016] [:error] [pid 31303] [client 108.162.246.66:34563] PHP Notice: Array to string conversion in /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Session/Exception.php on line 58
    [Sun Oct 16 05:28:43.462019 2016] [:error] [pid 31303] [client 108.162.246.66:34563] PHP Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /var/www/html/newscoop/cache/prod/classes.php(Line:421): Error #8 SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) Array' in /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Session.php:482\nStack trace:\n#0 /var/www/html/newscoop/application/Bootstrap.php(30): Zend_Session::start()\n#1 /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php(669): Bootstrap->_initSession()\n#2 /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php(622): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('session')\n#3 /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php(586): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL)\n#4 /var/www/html/newscoop/vendor/bombayworks/zendframework in /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Session.php on line 482


  • 2 Comments sorted by
  • Hello, I'm experiencing problems installing the Paywall Plugin.

    I am trying to make a section (not an article/issue/publication) available to subscribers - the rest of the website should be open to visitors.



    a. Paywall admin backend - I have configured a new subscription called "Yearly", with the type "section" and period "365 days", price "49.99" and currency "EUR" ("Is Template?" says "no")

    b. Yml config - My application/configs/subscriptions/subscriptions.yml file has the following in it:

    subscriptions:
    specified_article: Yearly
    type: section
    range: 365
    price: 49.99
    currency: EUR
    specify:
    publication: 2
    issue: 50
    section: 400
    article:
    articles_from_publication:
    type:
    range:
    price:
    currency:
    specify:
    publication:
    article:
    type:
    range:
    price:
    currency:



    [I am not using Paypal so I have deleted the Paypal reference in your sample .yml file]



    c. Changes to article.tpl (Liquid theme)

    I have made the following changes to the article.tpl file (since the one for the liquid theme is different from the one for Quetzal which your example code is based on):



    {{ if $gimme->article->type_name=="page"}}

    {{ include file="page.tpl" }}


    {{ elseif $gimme->article->type_name == "debate" }}

    {{ include file="article-debate.tpl" }}

    {{else}}



    {{ include file="_tpl/_html-head.tpl" }}




    {{ include file="_tpl/header.tpl" }}






    {{ $subscription = $gimme->user->subscriptions->has_article($gimme->article->number) }}
    {{ if !$subscription || !$subscription->is_active }}
    {{ subscribe_form }}{{ /subscribe_form }}
    {{ else }}
    {{ include file="_tpl/article-cont.tpl" }}
    {{ /if }}


    {{ render file="_tpl/article_box-most_tabs.tpl" issue=off section=off cache=600 }}






    {{ include file="_tpl/footer.tpl" }}
    {{ include file="_tpl/_html-foot.tpl" }}

    {{/if}}


    d) I have also copied the sample templates in the _paywall folder to var/www//html/newscoop/themes/pulication_2/theme_1/_paywall



    e) Apache error log

    There are errors in the apache log file (could these be to do with permissions - since an attempt is being made to access cached files?!)

    [Sun Oct 16 05:15:54.794916 2016] [:error] [pid 31266] [client 141.101.99.63:9091] PHP Fatal error: Call to a member function has_article() on a non-object in /var/www/html/newscoop/cache/a35efac0ec87c29defe61fe68d5f954ee898a6da.file.article.tpl.php on line 71, referer: http://www.xxx.com/en/public/xxx_Magazine [NB THIS IS THE NAME OF THE SECTION I have specified in the .yml file]/
    [Sun Oct 16 05:28:43.424595 2016] [:error] [pid 31303] [client 108.162.246.66:34563] PHP Notice: Array to string conversion in /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Session/Exception.php on line 58
    [Sun Oct 16 05:28:43.462019 2016] [:error] [pid 31303] [client 108.162.246.66:34563] PHP Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - /var/www/html/newscoop/cache/prod/classes.php(Line:421): Error #8 SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) Array' in /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Session.php:482\nStack trace:\n#0 /var/www/html/newscoop/application/Bootstrap.php(30): Zend_Session::start()\n#1 /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php(669): Bootstrap->_initSession()\n#2 /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php(622): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('session')\n#3 /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Application/Bootstrap/BootstrapAbstract.php(586): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL)\n#4 /var/www/html/newscoop/vendor/bombayworks/zendframework in /var/www/html/newscoop/vendor/bombayworks/zendframework1/library/Zend/Session.php on line 482


  • Any takers?

    Although I'm used to delays with Newscoop, I would have thought someone might be able to advise on the correct configuration (or post a working example) of a .yml file to make only a section of a publication accessible to subscribers for a year using the Paywall plugin ...