Needs work
Project:
MoneySuite
Version:
7.x-10.x-dev
Component:
ms_ppv
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2015 at 13:29 UTC
Updated:
13 Jan 2016 at 18:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Paulset commentedComment #3
Farreres commentedI am using pay per view and it is working ok, showing the protected message. If you explain better your case maybe I can help you.
About the stable version, the code is itself already stable. I only want to make sure we didn't add any bug while branching.
Comment #4
Paulset commentedThank you for your answer.
I am going to try to explain better:
1/ I activated modules: ms_core, pay per view;
2/ in the permissions I authorized the guests in: Access Checkout Page, Access Cart ( ms_core ), Purchase premium content , View own purchased content (pay per view) ;
3/ in the type of contents "Article" I checked "Activate Pay Per View";
4/ then I created an Article.
When I am an administrator I can reach the text, but in guest I see only: the title, and "submitted by...", the rest is invisible. No button to put in the basket...
Otherwise I have an error :
Notice : Array to string conversion dans _views_data_process_entity_types() (ligne 109 dans /Applications/MAMP/htdocs/MYSITE/sites/all/modules/views 2/includes/cache.inc
Do you know where from could come the problem?
Comment #5
daniel wentsch commentedHaving the same issue. My guess is MS is not compatible with more recent versions of PHP. I tried it on 5.5 and 5.6, what are you guys using?
PS: Do you also get "Missing text format: 1" logged in Watchdog every time you try to access content that's supposed to be payed?
Comment #6
daniel wentsch commentedGot it!
check_markup() is called with $format_id = 1. If I set this to 'filtered_html' it works.
Another solution is to remove the text format argument completely, which would mean falling back to the result of filter_fallback_format(). To set another Fallback format but plain_text you'd have to manually change "fallbak_format" in the variable table or run variable_set() once: variable_set('filter_fallback_format', 'YOUR_DESIRED_FORMAT');
Comment #7
Paulset commentedGreat Daniel, thanks ! It works for me too.
Comment #8
Farreres commentedIt was me who added the check_markup thing. It is something I had been asking for a lot of time and now I had the opportunity to add it. I forgot posting a task about this modification as I have been doing with the other ones. In fact I spent a lot of time trying to show the format filters option below the field but I wasnt able to do it, so I decided to call check_markup with the basic filtered_html format. Removing it is no option, it must be done correctly but this must stay in the code. In my case, the former code is working, I will try the later one with from the patch.
Comment #9
Farreres commentedPatch applied
Comment #10
daniel wentsch commentedI meant removing the (second) argument, not the check itself. As I said, that would mean falling back to the result of filter_fallback_format().
Under certain circumstances there is no $format_id = 1 (for example when filtered_html was deleted).
Anyway, thanks for committing. For the future it would be nice to attribute patch authors though.
Comment #11
Farreres commentedDaniel, are you experienced coder and do you have experience in committing? I have never used git and yes, I agree patch author should be added. Do you want to be added as maintainer so you can commit yourself?
About the filter thing, my original idea was to show in the form, below the field, a selector to choose the filter you want. But I couldn't manage to do it. I have found tons of pages explaining how to hide this but just a few explaining how to add them to the form.
As it seems, the idea would be to add
['format']['guidelines']['#access']=TRUE;
['format']['help']['#access'] = TRUE;
But I tried it with no success. Maybe I am missing something more.
Any ideas?
Comment #12
daniel wentsch commentedHi Farreres,
I'm not the best coder but I find my way around I guess. And regarding Drupal ecosystem until now I've only been working with sandboxes. Anyways, I'm used to Git and willing to learn, so I wouldn't mind being a maintainer and help out here as long as I'm using Moneysuite myself.
Regarding the filter thing here's a patch, not heavily tested,but worked for me. We have to use type "text_format" instead of "textarea". If that works out for you we might even drop the check_format part?
Here's the FAPI reference that shows the available form elements: https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
Cheers,
Daniel.
Comment #13
Farreres commentedHi Daniel, I'm sorry, been very busy last weeks and couldn't even log into drupal. Adding you as maintainer in MoneySuite right away.
I am checking your filters patch now and maybe adding more of them around the module... Thanks a lot, I couldn't manage to find it!
Comment #14
Farreres commentedThe text_format seems to correct part of the problem. Maybe we can remove check_format then. I will test it and add some text_formats more.
Comment #15
Farreres commentedI have applied your suggestion in my local install as a test and something weird is happening. I have edited the textarea fields into text_format adding the format parameter:
in function function ms_ppv_form_alter twice, once in case node-form and once in case node_type_form:
Also in ms_ppv_field_formatter_settings_form:
and in ms_ppv_field_group_format_settings
But now, when I go to the node type and I set a field to display as ppv field, the protected message is not getting saved, it is getting lost. Will continue testing, but if someone can help with this I would thank you.
Comment #16
daniel wentsch commentedHi Farres,
I'm not using protected fields on my current setup so right now I'm not able to reproduce the behaviour, sorry.
And thanks for adding me as a maintainer :)
Comment #17
Farreres commentedChanging into text_format had more implications. Text formats are stored as arrays with value and format, so I had to touch more code. Now it is working in my local install but it should be more thoroughly tested. Commiting now.
Comment #20
daniel wentsch commentedI guess for me the latest changes lead to not being able to save the "Protected Content Message" anymore. Not 100% sure yet about the real source of the issue,but as a matter of fact the message stays empty, which is really troublesome to say the least. Investigating further.
Notice: Undefined index: format in ms_ppv_node_view() (Zeile 1220 von /xxx/sites/all/modules/contrib/moneysuite/ms_ppv/ms_ppv.module).
Comment #21
daniel wentsch commentedAlso, marking the format selection for protected content message as required results in editors having to make a choice even if they don't want to override PPV settings on a per node-basis.
Comment #22
daniel wentsch commentedIts getting more and more funky with current dev. My entire site is rather broken now:
- Protetected Content Message on Content Type administration page is reset to be completely blank upon every save, no error logged
- Overriding PPV settings per Node is not saved either and throws two errors for every attempt (Undefined index: format and Undefined index: value; both in ms_ppv_node_view(), and nothing being saved.
Comment #23
Farreres commentedPlease read this other issue https://www.drupal.org/node/2616012. There was another problem that appeared after text_format was inserted. I first thought it was caused by text formats, but maybe not. I could try removing the modifications of text_formats to see if the error from the other issue keeps getting corrected.
Comment #24
Farreres commentedDaniel, I have reverted some editions I had applied to ppv field formatter, maybe this caused your problems. Let's see if the problem is solved.
Comment #25
daniel wentsch commentedThanks Farreres, but still not working for me. Updated to latest dev (Dec 21), still the message is not saved when editing the content type.
Even worse: now I can even see nodes that had to be purchased previously (I'm using some custom logic to decide when to switch to teaser view and make nodes appear as protected).
(This issue was most probably unrelated and has disappeared without any changes to PPV)What happens on your setup if you make any changes on a PPV-enabled content type? Just working as expected? And how about editing purchasable nodes that don't have overridden Content Type Settings? Don't these (unnecessarily) force you to set a format for the Protected Content Message?
I'm not using ppv field formatters at all btw.
Will try uninstalling PPV
Comment #26
daniel wentsch commentedUninstalled and re-installed PPV, still having the same problems. Can't see a relation to #2616012: Warning: mb_strtolower() expects parameter 1, adding views works without problems, no mb_strtolower errors whatsoever. I'm really lost here :(
Comment #27
tontoman commented@ Daniel Wentsch, The views mb_strtolower problem has been an issue with views and ppv module for quite a while and when removing ppv module and only the ppv module ... and I did check with all the other MS suite of products and the issue would disappeared, even doing three to four fresh installs with current drupal and the ppv moneysuite installations the problem persisted.
Guess what .... now when installing a fresh ppv module (yesterdays Moneysuite version) and when creating a new view the issue is no longer. I will endeavor do to keep testing just in case its a Claytons Bug. "The Bug you have when you think you don't have a Bug."... Great work, thanks all.
Comment #28
Farreres commented@daniel: so the problem was not coming from my work on field formatters. I will then continue my work with this because I think it is the way to make it all work together. The problem is that text_formats are complex, not just a plain text, but an array. It seems text_formats are only half supported, all the work is left for the module developer to make it work. I think this is the way to solve the problem, give me some days.
Comment #29
Farreres commented@Daniel: I have started solving the problem. Right now the node type page loads correctly protected message and format. It has required a database update, so please make sure to run update.php first. Then you will need to save the node type protected content message and format again for it to update itself.
Now, I don't know if the display is correct. Please, tell me what is missing. I have only concentrated on solving the storage of message and format, but I am not sure if field display should also be touched in order to everything work ok.
Comment #30
daniel wentsch commentedI'm sorry but as I desperately need to get this feature published I decided to invest the time to switch over to Commerce License, so currently I don't have the time to further invest on MS.
Comment #31
Farreres commentedOk, up to you. This is open source and I do what I can in my free time. You do well going other way. Bye.