expressodev / rsvp

RSVP add-on for ExpressionEngine
Other
19 stars 8 forks source link

Not appearing in mulit-site templates #4

Open Denham opened 11 years ago

Denham commented 11 years ago

Just thought you should be aware of the problem when showing events from another site in EE using the MSM; essentially the RSVP stuff will only work on the MSM site where the channel originates.

EE 2.6.1 MSM 2.1.5

Here is an example of the template tag we are using that doesn't work. It's on a "community" MSM site showing events from an "events" MSM site:

{exp:channel:entries site="events" channel="all-events" disable="member_data|pagination|categories" show_future_entries="yes" show_expired="yes" sort="asc"}

<div class="event">
    <img src="{banner:url}" />
    <h2>{title}</h2>
    <h3>{entry_date format="%D, %d %F %Y  "}</h3>
    <h4>{if event_location} - {event_location}{/if}</h4>
    <p>{event_full_details}</p>     

    {exp:rsvp:if_rsvp_enabled entry_id="{entry_id}"}
    <p>RSVP is enabled!</p>
    {/exp:rsvp:if_rsvp_enabled}
</div>

{/exp:channel:entries}

Works fine if the template is used within the actual "events" site the "all-events" channel is ("RSVP is enabled" is visible). Just not in any other MSM site.

All of the exp:rsvp tags have the same problem.

I think the problem is

function get_rsvp_event_by_id($entry_id)

not returning anything when the tag is used on MSM sites. EG: in mod.rsvp.php, the function if_rsvp_enabled (line 51),

$this->EE->rsvp_model->get_rsvp_event_by_id($entry_id)

doesn't return anything (so the condition fails).

Wish I could help more, but I'm definitely not a PHP dev. Hopefully this makes enough sense.

amacneil commented 11 years ago

Thanks for the report. From memory RSVP does not actually support MSM, so this may be a limitation you will have to live with. Happy to accept a pull request if anyone wants to take it on though.