Search

I couldn’t recreate this. Can you give me a test case when you see this occurring?

Just tested with a clean install to make sure everything is fine.

I cloned symphony integration and your eventex repo, created two dumb sections and attached the event to the page. What I get is a specular copy of post-values:

<events>
    <update>
        <entry id="1" result="success" type="created" section-id="1" section-handle="dumb">
            <message>Entry created successfully.</message>
            <post-values>
                <name>asd</name>
                <author>lol</author>
            </post-values>
            <post-values>
                <name>asd</name>
                <author>lol</author>
            </post-values>
        </entry>
        <entry id="2" result="success" type="created" section-id="2" section-handle="dumb2">
            <message>Entry created successfully.</message>
            <post-values>
                <name>something</name>
            </post-values>
            <post-values>
                <name>something</name>
            </post-values>
        </entry>
    </update>
</events>

On one use case before (2.0.7) this wasn’t happening. But by creating the simplest example with two sections and a text input in each, I recreated this successfully.

I’ve issued a fix. Rather than checking the Symphony version number itself I’ve decided to check whether the <result> contains an element name called <post-values> — rather like the object-detection vs. browser-sniffing debate in JavaScript.

Thanks for hunting this bug down :-)

Much better approach, great!

I’ ve noticed just a minor error at line 553… LOL :)

Ha! Thanks…

Just curious did your fixes make eventex compatible with front end membership?

Oh hey I just figured out whats wrong!

the custom event does not show up in the front end memberships Roles page, where you would normally give permission for a user to use the event.

is there a workaround?

Ok I can get it to show with this but it doesnt do anything. I guess the action needs some kind of link to the membership but my php is pretty bad.

public static function showInRolePermissions(){
        return true;
    }

Just curious did your fixes make eventex compatible with front end membership?

I’ve not used Frontend Members yet so I can’t comment. Adding the above manually to the event should make it appear, as you say. It’s likely something extra needs to be done, but I have no idea what!

I can’t think of a clean way to achieve this.

The problem is how EventEx handles multiple Events submission starting from a single class (the one you manually create).

For each section involved, it instantiate a GenericSectionUpdate object that will fake the event. The problem arises when the members extension try to determine permissions given an event object, checking if the object class name is the same as the event name stored in the db. Unfortunately, this will always fail..

Let’s see if we can work this out. I just made a commit that should solve this issue.

Grab the latest source code. In your event file, make sure to have the function posted above:

public static function showInRolePermissions(){
        return true;
}

and a new class definition. The name of the class should be the name of your event without the event prefix. In the eventex readme example you define a class named eventupdate_two_sections - your new class would be update_two_sections.

Make sure it extends GenericSectionUpdate and append it to your event file (outside of the previous class definition):

class update_two_sections extends GenericSectionUpdate { }

Your new file would look something like this.

Looks complicated? This is the best I can do :) Let me know if this stuff works.

I should also note that if you define your events as always, eventex would behave correctly but of course you’ ll run into trouble when using Members Extension.

You the man alpacaaa

Works perfect.

I’m trying to get EventEx and Members to work together in the Forum ensemble, but I’m not having any success trying to create a new discussion. Member role permissions are failing for the Forum: Create Discussion event:

<forum-create-discussion>
    <entry result="error" section-id="2" section-handle="discussions">
        <filter name="permission" status="failed">not authorised to perform this action</filter>
        <post-values>
            <topic>asdf</topic>
            <created-by>1</created-by>
            <last-post>1</last-post>
        </post-values>
        <message>Entry encountered errors when saving.</message>
    </entry>
    <entry result="error" section-id="3" section-handle="comments">
        <filter name="permission" status="failed">not authorised to perform this action</filter>
        <post-values>
            <comment>asdf</comment>
            <created-by>1</created-by>
        </post-values>
        <message>Entry encountered errors when saving.</message>
    </entry>
</forum-create-discussion>

But, if I try to make the modification that @alpacaaa has made to the EventEx extension, I get the following error:

Fatal error: Class 'Administration' not found in    /Users/stephen/Sites/sym/test/extensions/members/fields/field.memberlink.php on line 227

You can view the code on GitHub:

I have attached the ensemble, in case you want to try out the test version (modified to use alpacaaa’s EventEx testing branch).

Attachments:
forum-ensemble.zip

Ah, I had tried this, but was pointing to the wrong file. Now, if I add this to /extensions/members/fields/field.memberlink.php file, the event saves the entry to one section, but not the other:

include_once(CORE . '/class.administration.php');

It is working. Maybe there’s an issue with my form.

Mmh I don’t like that inclusion, as it introduces a potential security flaw.

It looks similar to the patch proposed by @bambocci and allows members to arbitrary determining member link field value, definitely something that should be avoided.

Hmm. Well, I certainly don’t want to introduce any security flaws. I would gladly remove this if I knew another way to avoid the fatal error. Any ideas?

Sorry for not using github.

You can find a small patch here. It basically prevents user to determine their member’s id when submitting entries. This is a limitation for a developer… but at least things get interesting! :)

Cool. That worked. Thank you very much, alpacaaa.

can eventex be used with email notification? or email template filter extension

Hi, I tried to use EventEx to save multiple values in a Select box link but i get an error message

strlen() expects parameter 1 to be string, array given

An error occurred in D:wampwwwmediaextensionseventexlibclass.eventex.php around line 557

my form look like this

<input type="hidden" name="interface[text][]" value="300" />
        <input type="hidden" name="interface[text][]" value="223" />
        <input type="hidden" name="interface[text][]" value="222" />

any idea to solve it?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details