Forum
This is an open discussion with 123 replies, filed under Ensembles.
Search
Thanks, @alpacaaa. How did that get it there? ;-)
I’ve added better form validation for creating and modifying member profiles.
I’ve also discovered that creating new discussions does not work. There is a Forum extension that provides events to handle forum discussions. The events are customized to save to the Discussions and Comments sections with a single action. I wasn’t able to figure out how to get the Forum extension’s events to work with the official Frontend Membership extension.
So, I tried using EventEx to save to these two sections. But, I’ve run into compatibility issues with the Frontend Membership extension. I think this is the last issue to deal with before the Forum ensemble can finally be released.
If anyone has any ideas about how to solve either of these compatibility issues, please let me know. Thanks.
If the forum extension provides the events I’m not sure you should rely on EventEx. EventEx by it’s very nature is one big hack, and I’m not sure it should be used in such a way. To me the Forum and Members extensions should play nicely together without any glue; they do on this here forum after all.
Yeah. You’re right, Nick. I’m finding that out the hard way. So, how do I make the Forum extension events play nicely with the Members extension?
So, how do I make the Forum extension events to play nicely with the Members extension?
:-)
I think that once 2.0.8 is running stable, Alistair should re-work this stuff. (I’d rather wait for Symphony 2.1 until 2089.) It’s a mess at the moment.
[EDIT]: No, I want 2.1. Would be nice for Xmas. :-)
I’d love Alistair to help out. I’m impatient, though. Plus, this is one way to find out how Symphony works. Nick, I’ve rolled my EventEx experiment into a separate branch.
To be a little more descriptive about what is still going wrong, then, here’s the error I get when I try to create a new discussion:
Missing argument 3 for Role::canPerformEventAction(), called in /Users/stephen/Sites/sym/sym-forum/extensions/forum/events/event.forum_post.php on line 203 and defined /Users/stephen/Sites/sym/sym-forum/extensions/members/extension.driver.php line 360 355 356 public function canAccessPage($page_id){ 357 return !@in_array($page_id, $this->_forbidden_pages); 358 } 359 360 public function canPerformEventAction($event_handle, $action, $required_level){ 361 return ($this->_event_permissions[$event_handle][$action] >= $required_level); 362 } 363 364 }
I can try hard-coding a value as the third parameter, but I’m not sure what value it’s looking for yet.
With some changes to the Forum and Members extensions, I am now able to save Discussions and Comments. However, I can’t display them very well. The SQL is off, and I’m out of my depth here. The XML data is being returned with the following error:
<forum-discussions> <error>1146: Table 'sym_test.sym_entries_data_0' doesn't exist on query SELECT SQL_CALC_FOUND_ROWS pinned.entry_id AS `id`, pinned.value AS `pinned`, closed.value AS `closed`, creation_date.local AS `creation-date`, last_active.local AS `last-active`, created_by.member_id AS `created-by-member-id`, created_by.username AS `created-by-username`, last_post.member_id AS `last-post-member-id`, last_post.username AS `last-post-username`, topic.value AS `topic`, COUNT(comments.relation_id) AS `comments` FROM `sym_entries_data_16` AS `pinned` LEFT JOIN `sym_entries_data_17` AS `closed` ON pinned.entry_id = closed.entry_id LEFT JOIN `sym_entries_data_0` AS `creation_date` ON pinned.entry_id = creation_date.entry_id LEFT JOIN `sym_entries_data_15` AS `last_active` ON pinned.entry_id = last_active.entry_id LEFT JOIN `sym_entries_data_12` AS `created_by` ON pinned.entry_id = created_by.entry_id LEFT JOIN `sym_entries_data_14` AS `last_post` ON pinned.entry_id = last_post.entry_id LEFT JOIN `sym_entries_data_11` AS `topic` ON pinned.entry_id = topic.entry_id LEFT JOIN `sym_entries_data_19` AS `comments` ON pinned.entry_id = comments.relation_id WHERE 1 GROUP BY pinned.entry_id ORDER BY pinned.value ASC, last_active.local DESC LIMIT 0, 20</error> </forum-discussions>
So close, yet so far.
From this snippet:
Table 'sym_test.sym_entries_data_0' doesn't exist
I would assume that a field_id
is missing (resp. has a value of ‘0’) when the SQL is built.
It’s in this line:
LEFT JOIN `sym_entries_data_0` AS `creation_date` ON pinned.entry_id = creation_date.entry_id
Right. But I have no idea where that ID is coming from. MySQL is not one of my strong points, so I’m having a hard time reading this. I even tried hard-coding the tables, but without much success, since I’m only guessing.
This output is coming from the data.forum_comments.php file, lines 93 - 123:
try{ $comments = ASDCLoader::instance()->query( sprintf( "SELECT SQL_CALC_FOUND_ROWS comment.entry_id AS `id`, comment.value_formatted AS `comment`, created_by.member_id, created_by.username, date.local AS `date`, email.value AS `email` FROM `sym_entries_data_%d` AS `comment` LEFT JOIN `sym_entries_data_%d` AS `created_by` ON comment.entry_id = created_by.entry_id LEFT JOIN `sym_entries_data_%d` AS `date` ON comment.entry_id = date.entry_id LEFT JOIN `sym_entries_data_%d` AS `email` ON created_by.member_id = email.entry_id LEFT JOIN `sym_entries_data_%d` AS `discussion` ON comment.entry_id = discussion.entry_id WHERE discussion.relation_id = %d ORDER BY date.local ASC LIMIT %d, %d", self::findFieldID('comment', 'comments'), self::findFieldID('created-by', 'comments'), self::findFieldID('date', 'comments'), self::findFieldID('email-address', 'members'), self::findFieldID('parent-id', 'comments'), (int)$this->dsParamFILTERS['discussion_id'], max(0, ($this->dsParamSTARTPAGE - 1) * $this->dsParamLIMIT), (int)$this->dsParamLIMIT ) ); }
I’d like to share some thoughts I had.
This ensemble is awesome. It’s perfect to show the capabilities of symphony and has been put together with love and dedication which makes it even more appreciable.
But I feel like it’s facing too many problems lately.
At its heart, we can see the forum extension, which have been developed when members support in symphony wasn’t that good. The extension contains a lot of custom code but works really great.
Now we have a far better Members extension available, though.
From my point of view, the Forum extension was built because there were no other means to handle permissions — is this still true?
Of course the extension provides far more goodness than just permissions, but I feel like such additions could be handled with pure symphony (some tweaking is still needed).
Therefore, I suggest to think carefully on the direction this ensemble should take. If it was born as an attempt to understand symphony internals, then I think we finally had the tools to build something with just symphony and a necessary extension (members).
This would be challenging and not easy, I guess. But I swear it would worth it :)
Don’t take me wrong, these are just thoughts I feel was right to share. It took me a while to write this stuff, apologize for errors.
It seems the Forum extension is necessary as a way to do what Symphony cannot do natively, which is to create entries in multiple sections with a single action. I started trying to do the same thing with EventEx, which does allow this functionality, but Nick describes this extension as a hack.
That leaves me wondering how the Forum ensemble could be built without the Forum extension, then. It looks like I am pretty close with the Forum ensemble.
I think I may have only this one issue left to figure out:
<forum-post result="error"> <message>Entry encountered errors when saving.</message> <parent-id type="missing" /> <post-values> <topic>asdf</topic> <comment>asdf</comment> <created-by>1</created-by> <last-post>1</last-post> </post-values> </forum-post>
See the attached ensemble.
This ensemble can be recreated by checking out the test branch from GitHub:
git clone git://github.com/bauhouse/sym-forum.git git checkout 149c1e71d60cdd49177 git checkout -b test git pull origin test git submodule update --init
Then install Symphony as usual.
This is about as close as I can get to the finished Forum ensemble. I think Alistair’s going to have to help me get the rest of the way. Please, Alistair?
Edit: Alistair, I’ve figured out the missing ID issue. It was a misconfiguration. :-)
I just downloaded and installed this ensemble from the main download, not from github, and there is a minor bug in the install.php
On line 194, there is the text for an email. The quotes in the text are not escaped therefore terminating the string prematurely and causing havoc :)
Sorry, don’t use the main download for now. It’s quite broken. Try the attachment above or use git to clone as described above. The master branch is not working so well — all very experimental. Once I have this last issue resolved, I’ll get this into the master branch and the main download.
Ayeee I should read before I type…
Apologies
By the way, there is a working version of this ensemble using a modified version of Symphony 2.0.6. There are some forward compatibility issues, is all.
Sorry, you’ve confused me!
I originally downloaded the ensemble, direct from the Downloads > Ensembles page, and this is what was broken. That seems to be what you linked me too? Or did I miss something?
Sorry, I’m the one who is confused. If that download is not working, then I need to fix it up. Thanks for letting me know.
Create an account or sign in to comment.
There’s a problem with the redirect on member registration :)