Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding spam protection code from current silverstripe.org forum #98

Merged
merged 1 commit into from Sep 1, 2014
Merged

Adding spam protection code from current silverstripe.org forum #98

merged 1 commit into from Sep 1, 2014

Conversation

halkyon
Copy link
Contributor

@halkyon halkyon commented Sep 1, 2014

No description provided.

@halkyon
Copy link
Contributor Author

halkyon commented Sep 1, 2014

@camfindlay I've rebased this from the internal forum and added tests. Want to take a look? :)


return $this->updateLastPost();
public function getLatestPost() {
return DataObject::get_one('Post', "\"ThreadID\" = '$this->ID'", true, '"ID" DESC');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This using old ORM style? is there a new getone that retains the caching?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, using this retains caching over Post::get()->filter('ThreadID', $this->ID)->sort('"ID" DESC')->first();. There is no replacement in new ORM that retains caching at this stage, so I don't think we should change to the new syntax for this yet.

@camfindlay
Copy link
Contributor

3.1 tests seem to pass. Is there any old 2.4 code in here?

@halkyon
Copy link
Contributor Author

halkyon commented Sep 1, 2014

@camfindlay I don't believe so, apart from the use of get_one() which is still necessary due to caching, and to make consistent with getFirstPost()

camfindlay added a commit that referenced this pull request Sep 1, 2014
Adding spam protection code from current silverstripe.org forum
@camfindlay camfindlay merged commit a4320b2 into silverstripe-archive:master Sep 1, 2014
@halkyon halkyon deleted the spam_protect_additions branch September 1, 2014 04:36
@camfindlay
Copy link
Contributor

perhaps we should look to tag a 0.7 branch post launch ;)

@camfindlay camfindlay added this to the 0.7.0 milestone Sep 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants