Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Apr 2014 at 11:08 UTC
Updated:
15 Jun 2014 at 12:43 UTC
Jump to comment: Most recent
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxthelynge2242143git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
thelynge commentedJust bumping this. Errors reported by pareview were fixed.
Comment #3
brockfanning commentedHi, cool submission! Here are my nitpicks/comments, in no particular order:
Hope this helps, good luck!
Comment #4
brockfanning commentedSome more general feedback, after further thought: I think that this idea may suffer from being something that the Views module could do instead. I'd recommend thinking more on the use-case that you had in mind, and see if you can add some additional features/functionality that would justify using this as an alternative to making a Views view with start/end date filters.
Comment #5
thelynge commentedComment #6
thelynge commentedHi. Thanks for taking a look at it.
1. spelling mistake has been fixed.
2. clone description has been changed.
3. new branch "7.x-1.x" has been created.
4. using EntityFieldQuery instead now.
5. labes have been changed and descriptions were added.
6. returning nodes now along with links. should be more than enough for this purpose.
7. it's now possible to sort ascending/descending order. setting on config page.
8. I'm only using hook_init() for the constants because the code style checker wasn't happy with setting them outside a function.
9. the backup query is basically the whole point of the module so I'm keeping it. The goal is not to show content from exactly x days ago, it is to fill up a teaser with content from approximately x days ago. If you don't write a whole lot of content, the teaser would be half empty all the time. The backup query increases my chances of having a teaser with a full limit of content. With the views module I wasn't able to get this.
Comment #7
thelynge commentedBump :)
Comment #8
klausiyou need to set the status to "needs review" if you want to get a review, see the workflow: https://drupal.org/node/532400
Comment #9
thelynge commentedComment #10
brockfanning commentedIf #9 is the whole point of the module, I think it needs to be detailed in the README. I have other comments but will hold off until I see an explanation of this double-query functionality.
Also a coding note: You can put the sort direction directly into your queries, and then you wouldn't have to sort the arrays afterwards. Probably not a huge deal but it will avoid some PHP load.
Comment #11
thelynge commentedReadme has been updated.
Because of the double-query it is not possible to a full sorting in sql. Sorting needs to happen after merging the results of the queries to the the desired order.
Comment #12
joachim commentedThis is a hook implementation, so should follow standards for documenting it. (There are several instances of this!)
Using hook_init() for defining constants is weird.
It's not recommended to invent a new subseection of config, unless you're part of a big area of functionality and you're going to provide lots of config subpages. That's not the case here.
Nobody seems to call this!
> 9. the backup query is basically the whole point of the module so I'm keeping it. The goal is not to show content from exactly x days ago, it is to fill up a teaser with content from approximately x days ago. If you don't write a whole lot of content, the teaser would be half empty all the time. The backup query increases my chances of having a teaser with a full limit of content. With the views module I wasn't able to get this.
I've read through the queries, and I don't see why this can't be done using Views.
You are asking for $limit nodes, created between $timestamp_primary, $timestamp_secondary.
If you get fewer than $limit back, then:
This is asking for ($limit - how many you got in the first query) that are older than $timestamp_primary.
So surely if you simply query for $limit nodes that are older than $timestamp_secondary, and order your nodes by created time descending, then either:
* you get $limit nodes that happen to be newer than $timestamp_primary
* you get fewer that are newer than $timestamp_primary, and the query ordering takes care of getting you older nodes that the end.
Unless I am missing something here, this could all be done in Views.
Comment #13
thelynge commented@joachim thanks for your feedback.
- I added "Implements hook_*" to the comment documentation. That's what you had in mind, right?
- Constants were moved out of init function. I only put them in there in the first place because my code style checker complains when they are outside.
- Config page was moved to the Content subsection.
- Access function was removed. Legacy :)
Regarding the purpose of the module. What you outlined could probably be covered by the Views module. But I want the primary content from the first query and only when there's not enough there (content newer than the start date), I want the older content only if there's not enough newer content. I haven't been able to get this exact content in this order from Views.
Comment #14
joachim commented> But I want the primary content from the first query and only when there's not enough there (content newer than the start date), I want the older content only if there's not enough newer content.
But that's exactly what you'd get with the Views configuration I described.
Suppose I want 5 nodes. Today is 31 July. I want ideally nodes created since 1 July. If we have these nodes:
* 31 July
* 27 July
* 23 July
* 14 July
* 9 July
* ---- cut-off point
* 28 June
-- then I have 5 nodes since 1 July, and all is fine: the view returns those nodes. The 28 June node is not returned, because it's not in the first 5.
Now suppose we don't have enough nodes in July:
* 31 July
* 14 July
* 9 July
* 28 June
* 23 June
* ---- cut-off point
* 14 June
Now the first 5 nodes takes us further back. We need to include the 23 June and 14 June ones to get 5 nodes.
Have I misunderstood something? What would your module do differently?
Comment #15
thelynge commentedThat's not exactly what I had in mind. But I see what you mean. The difference between the two is almost not existent :)
I will close this issue and work on a better description and other improvements. This discussion made it clear that it's better that way. Or maybe the module is so specific to the problem I had, that it will not be needed by others.
Still thanks for taking a look at it :)