kapilt / getpaid

Automatically exported from code.google.com/p/getpaid
0 stars 0 forks source link

"Payable" tab not showing in Plone 3 #152

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. make a piece of content "buyable" or a donation
2. look at the tabs on the content

What is the expected output? What do you see instead?

In the Plone 2.5 version of GetPaid, a "payable" tab appears to the right
of "edit", "sharing"...In Plone 3. This doesn't work. 

the Payable tab is linked to the edit-buyable or edit-donate browser views.
 I *think* that is only done in zcml with a browser:menuItem.

Original issue reported on code.google.com by cjj.ifpe...@gmail.com on 7 Dec 2007 at 9:46

GoogleCodeExporter commented 8 years ago
I think this needs to be configured in actions.xml of the product extension 
profile for Plone 3. See the attached 
patch.

Original comment by michael....@gmail.com on 11 Dec 2007 at 9:20

Attachments:

GoogleCodeExporter commented 8 years ago
Hi Michael,

IIUC, adding your patch has no effect (for better or worse) on Plone 2.5.  
Which is
good, as CMFonFive does its work there.  Only on Plone 3.0 does it add the 
action. 
Right?

Looks good to me, with one change: it needs a condition or else this is shown 
for
every object.  This condition seems the most logical to me:

  object/@@edit-buyable|nothing

Seems to be working fine then.

Can you commit it with that change?  Preferably with a browser test to show 
that this
action is now available on 2.5 and 3.0; but I do not know how hard that is to 
add.

Original comment by maurits.vanrees on 11 Dec 2007 at 11:40

GoogleCodeExporter commented 8 years ago
assigning to maurits to take care of
michael - want to join the project? thanks for the patch

Original comment by cjj.ifpe...@gmail.com on 12 Dec 2007 at 4:33

GoogleCodeExporter commented 8 years ago
The condition needs to be:

  nocall:object/@@edit-buyable|nothing

The 'nocall' is needed because otherwise you end up with a maximum recursion 
error
when viewing a buyable object.

Hm, but with that code I get an extra test failure on Plone 3 with a maximum
recursion error.  We need to find a different condition.

Original comment by maurits.vanrees on 13 Dec 2007 at 11:49

GoogleCodeExporter commented 8 years ago
Fixed in r1117.  Commit message:
- Rename all @@edit-* browser pages to @@edit-payable.
- Add new browser view @@payable-content that simply returns True when
  content is payable and False otherwise.
- Add action 'buyable' in the CMF Action Category, silently ignored in
  Plone 2.5.  This has @@payable-content as expression for
  availability and @@edit-payable as url expression.

Thanks for providing the base for this, Michael.

Original comment by maurits.vanrees on 14 Dec 2007 at 11:33

GoogleCodeExporter commented 8 years ago
Maurits,
it seems to me that you could have done something more simple and that would 
work in
Plone 3 and Plone 2.5. Because right now the tabs are no more working in 2.5

I had the same problem with the getpaid.discount product (because I did the same
thing as you did to show up the "Discountable" tab).

I updated the PloneGetPaid code with a more simple code, see revision 1655. I 
ran the
tests on it and they all pass.

Feel free to revert if it breaks anything.

Original comment by lucielej...@gmail.com on 8 Jul 2008 at 3:51

GoogleCodeExporter commented 8 years ago
Hi Lucie,

I am sure it worked when I changed this half a year ago, so I guess in the 
meantime
somthing has changed that broke this; perhaps r1642 though I do not immediately 
see
anything wrong there.

I have not checked if your code works in practice, but I see two possible 
problems
with your commit:

1. Someone may already be using the now removed @@payable-content view in his 
own
product, which we would now break.  BTW, I added that small view because I had 
not
seen that there already was an @@getpaid_control view that that could do that. 
:-/

2. Existing Plone sites will still have the old action that you removed from
actions.xml.  So in plone 3 I suspect the tab may now show twice.  Or viewing a
payable item will give an error as it is calling @@payable-content, which does 
not
exist anymore (see problem 1).  Hm, but the condition is
"object/@@payable-content|nothing" so that could still work.

Original comment by maurits.vanrees on 8 Jul 2008 at 6:13

GoogleCodeExporter commented 8 years ago
Hello Maurits,

1. if someone is using @@payable-content and is using the trunk to develop, this
person can switch pretty easily to @@getpaid_control pretty easily during its
development.

2. For the action, the old action that I removed and the new action have the 
same id,
so when you run the generic setup steps, it just updates the old action.

Original comment by lucielej...@gmail.com on 8 Jul 2008 at 11:58

GoogleCodeExporter commented 8 years ago
Ad 1: I think @@payable-content was there since 0.3 or perhaps shortly after, 
not
just on trunk.

Ad 2: Ah, good point.

We (well, I) probably do not need to worry too much about this.  Heh, when 
googling
for 'payable-content' this issue is the first hit, so it is findable at least 
in case
anyone has a problem with it. :-)

Original comment by maurits.vanrees on 8 Jul 2008 at 1:38