This module enables user to manage blocks at node level.
It will help to manage the block of default theme at node level.
Note:- You must select the content type in block configuration.
Like:- Goto 'admin/structure/block/manage/search/form/configure' and click 'content types' tab and select the content type. eg:- Article.
https://drupal.org/files/project-images/block_reorder_content_type_selec...
-- STEPS TO FOLLOW --
1. Enable the module. After enabling, this will add a widget type.
2. Create a field of widget type Block Reorder in any content type.
Select the region. for that you want to reorder the
block. That content type must be selected for that block in block configure.
3. Create node of that content type and manage the order of block at node level
and see the respective changes.
Note:- You can not change the region of block at template level. Reorder only with in the region.
Project page: https://drupal.org/project/block_reorder
Screenshots:-
https://drupal.org/files/project-images/widget_2.png
Manual reviews of other projects
---------------------------------
New Manual Reviews:-
---------------------------------
https://drupal.org/comment/8660617#comment-8660617
https://drupal.org/comment/8660753#comment-8660753
https://drupal.org/comment/8664881#comment-8664881
---------------------------------------------------------------------------------------------------
https://drupal.org/comment/8513733#comment-8513733
Comment | File | Size | Author |
---|---|---|---|
#9 | Change theme.jpg | 358.82 KB | webmorozov |
#9 | No blocks.jpg | 138.07 KB | webmorozov |
#9 | Error 2.jpg | 187.66 KB | webmorozov |
#9 | Error 1.jpg | 197.83 KB | webmorozov |
#9 | Empty field.jpg | 67.87 KB | webmorozov |
Comments
Comment #1
merdekiti CreditAttribution: merdekiti commentedYou must check fix these errors first
http://pareview.sh/pareview/httpgitdrupalorgsandboxrkumar2189971git
Comment #2
PA robot CreditAttribution: PA robot commentedWe 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 #3
feyisayo CreditAttribution: feyisayo commentedHello RKumar,
Thanks for the module development.
A few things to note:
1) Change you your Git clone instruction to the use the publically available branch. The one you gave is the private one.
So instead of:
git clone --branch 7.x-1.x Rkumar@git.drupal.org:sandbox/Rkumar/2189971.git
Use
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Rkumar/2189971.git
2) Use the code review tool at http://pareview.sh/ to get an automated review of your code. This can be a good starting with regards to proper code formatting.
Best wishes with the code work.
Feyisayo
Comment #4
Rkumar CreditAttribution: Rkumar commentedComment #5
Rkumar CreditAttribution: Rkumar commentedComment #6
mayank_kanungo CreditAttribution: mayank_kanungo commentedHello Rkumar,
I Install module and follow instruction to setup.
I create field in content type "Basic Page". create new node of "Basic Page" where new field "reorder block" with block is available and allow me to reorder the blocks. that work perfect.
but when I Edit same node, "reorder block" field is display with no block in any region.
I can not see any block to reorder while node edit.
Comment #7
gobinathmComment #8
Rkumar CreditAttribution: Rkumar commentedHi mayank_kanungo,
I rechecked for the basic page also and its working fine.
So will you please share the exact scenarios.
Comment #9
webmorozov CreditAttribution: webmorozov commentedHello, Rkumar!
Thanks for an awesome module. It might useful in some case.
A few things to note:
1) As said feyisayo previously, please fix all issues that find code review tool at http://pareview.sh/:
Review of the 7.x-1.x branch:
Remove "version" from the ./block_reorder.info file, it will be added by drupal.org packaging automatically.
Coder Sniffer has found some issues with your code (please check the Drupal coding standards):
2) Some of the information from README file should be added to the project page as well.
Project page should show what that module will do. Please look at the other modules project page.
3) Please use more informative package in info file.
Not just "Custom". It may be related with fields or blocks. Please remove line version = VERSION
4) Code refactor & Errors
When I add new field and don't click to any region in "Default Theme Regions" -> block field was empty (in node adding form).
Look at the "Empty field.jpg"
So as I understand it's not "Default Theme Regions" - it regions that will be used in node edit form. Default mean that by default field will use that values on node form, but user can change it. In your case it's not clear. So please add some comments here.
I see that if user not set any checkbox you try to return all regions, but that code not work correctly now.
When I didn't set any checkboxes I have following array, it's not empty. So it not work.
I fixed that on my local copy and use regions from $region_to_show = system_region_list($theme, REGIONS_VISIBLE) but it not wokr too. There are other problems here:
I try to create new node so we shouldn't use arg(2) == 'edit'. In code there are a lot of validation like:
What happens if you will work with other entity not only node? I think it will not work.
We should refactor that.
All ordering logic from block_reorder_field_widget_form should be in separate function.
Also get $node_type from not correct. You can use '#bundle' from $element (see https://api.drupal.org/api/drupal/modules%21field%21field.api.php/functi...).
Also you are use node_load in
$node = (node_load(arg(1)));
May be problems with performance. You can get all data that you want for current field from parameters of block_reorder_field_widget_form.
5) Data not save after validation errors:
1. Click add new page
2. Reorder blocks & and don't input title
3. Click submit
4. Validation error output & order of blocks reset for default
6) When I save form and try to edit - All regions (in edit form) without blocks
Look at the "No blocks.jpg"
7) There are some errors when we change settings in field.
I cannot edit old nodes. Look at the
Look at the "Error 1.jpg" & "Error 2.jpg"
8) Try to change default theme.
Look at the "Change theme.jpg"
Best regards,
WebMorozov
Comment #10
Rkumar CreditAttribution: Rkumar commentedComment #11
Rkumar CreditAttribution: Rkumar commentedComment #12
Rkumar CreditAttribution: Rkumar commentedDone all Pareview suggested changes.
And resolve other mentioned issues.
Comment #13
Rkumar CreditAttribution: Rkumar commentedComment #14
mayank_kanungo CreditAttribution: mayank_kanungo commentedHi Rajkumar,
I am using basic drupal setup with multilingual configuration. form site :-
http://renaudjoubert.com/en/article/how-setup-multilingual-website-drupal-7
This might be because of multilingual environment.
I will try to test on drupal basic setup and let you know..
Thanks for your efforts...
Comment #15
Rkumar CreditAttribution: Rkumar commentedComment #16
Rkumar CreditAttribution: Rkumar commentedHi klausi,
Please review my module.
Thanks.
Comment #17
Rkumar CreditAttribution: Rkumar commentedComment #18
ericthelast CreditAttribution: ericthelast commentedGreat news, pareview.sh showed no errors!
manual review:
Comment #19
Rkumar CreditAttribution: Rkumar commentedHi ericthelast,
Thanks for your valuable feedback.
. I removed #theme or #theme_wrappers.
. In tpl file, i follow the core tpl file for block. That css & js required only in that particular tpl file. so no any need to write preprocess.
Please suggest me, how can i put efforts to make this project live.
Comment #20
itsmebhupendra CreditAttribution: itsmebhupendra commentedHi Rkumar,
I installed your module as per the instructions above.
After installation I edited the content type "Basic Page", and added a field named "Reorder" with the field type "Block Reorder" and widget type "Block Reorder".
After the installation and configuration, created a node of type "Basic Page" and there all the selected regions and blocks are available for reordering. I changed the order of the blocks and clicked the "Save" button.
#issue 1 : The node got created but there were no blocks visible on that page.
#issue 2 : When I opened the same node in edit mode the Reorder field only displays the block names with the message "No blocks in this region".
Bhupendra
Comment #21
Rkumar CreditAttribution: Rkumar commentedHi itsmebhupendra,
This modules provide to reorder block for default theme. and at "admin/structure/block", you must select that content type in block configure. Like in your case you have to select "Basic Page" content type in block configure.
Please see
https://drupal.org/files/project-images/block_reorder_content_type_selec...
Already mentioned in the documentation.
Comment #22
itsmebhupendra CreditAttribution: itsmebhupendra commentedHi,
Thanks for the reply! I tested this as per you saying. But:
This time, I assigned the blocks from Sidebar First to Header and saved the node.
On the node display page, none of the blocks appear.
When I went back to the node edit page, I saw that the the blocks which I moved from Sidebar First to Header, are still in Sidebar First region.
In my drupal (7.26) setup, the default theme is Bartik 7.26.
Comment #23
Rkumar CreditAttribution: Rkumar commentedHi itsmebhupendra,
I checked all the scenarios again when you give me first feedback.
My request is to please go through Read_me file.
"Note:- You can not change the region of block at template level. Reorder only with in the region."
This module can't change the region of block. Reorder possible only with in the region.
Thanks
Comment #24
j.branson CreditAttribution: j.branson commentedHi there. This is an interesting idea, but I can't get it working. There are a few things that might be affecting this. First the default options when I set up the block reorder field are all blank, but I have blocks in the regions that I selected. Second, when I've rearranged blocks on a node and I go back to edit that same node, the blocks don't show up. Third, reordering blocks doesn't seem to have any effect. I put one block on top of another and the rendering was still the other way around. If the reordering can only take place within regions, can you make a not of that in the field description, or work something out to prevent people from reordering between regions? Because otherwise this is confusing.
Once I've reordered blocks I get this message - * The changes to these blocks will not be saved until the Save blocks button is clicked. But there is no save blocks button. Only save node.
All of this could very easily be the theme and site configuration that I am testing on, but either way I'm concerned that there is basically no instructions as to how to set up the module - utilize description fields and give more documentation on the application and project page. What is the use case for this?
Thanks!
Comment #25
j.branson CreditAttribution: j.branson commentedWait...RE comment #24, now I see that it did reorder blocks within a region, but it did it in reverse order of the logic presented by the drag and drop. For instance, block 1 and block 2 were ordered like that 1 on top of 2 in the drag and drop, but they displayed 2 on top of 1 on page rendering. When I removed the reorder field, they went back to 1 on top of 2 display for rendering. So something is confused somewhere. Again this could be uniquely my configuration/theme, but either way more documentation could be useful so I know how it is supposed to work and can therefore determine if it is working correctly or not.
Comment #26
Rkumar CreditAttribution: Rkumar commentedHi j.branson,
I mentioned the things with screen-shots.
Now i highlighted the points and modify the documentation.
Please provide your valuable feedback.
Thanks.
Comment #27
Rkumar CreditAttribution: Rkumar commentedComment #28
Rkumar CreditAttribution: Rkumar commentedAll issue has been resolved.
Improve documentation.
Comment #29
klausiremoved automated reivew.
Comment #30
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #31
Rkumar CreditAttribution: Rkumar commentedComment #32
Rkumar CreditAttribution: Rkumar commentedComment #33
Rkumar CreditAttribution: Rkumar commentedComment #34
Rkumar CreditAttribution: Rkumar commentedHi klausi,
Thanks for your valuable feedback.
I applied the suggested changes.
Here are the points based on your reviews:-
1. This module provide the reorder of blocks at node. It will provide the functionality to change the order of block rendering for each node. By adding a field of type block_reorder, it will add the list of block for the selected region. Region need to select at field setting form and block must be selected for that content type in block config. Reorder is possible with in the region at node level.
2. Remove switch statement.
3. in block_reorder_field_widget_form(), form id will be different for each content type. so that i didn't use that. Still i reduced the possible arg() call.
4. Add the serialize property.
5. "block_admin_display_form1", name changed.
6. suggestion applied.
7. db_select changed to db_query.
8. block_reorder_fetch_field_type_name(), Doc improved. This function is used to fetch the field machine name.
9. _block_reorder_region_to_show(): Removed.
10. Removed arg() call.
11. Removed drupal_add_js() from tpl. It's my mistake. It's already include in page by block module.
Thanks.
Comment #35
dahousecat CreditAttribution: dahousecat commentedHi Rkumar,
This sounds like a good idea for a module - I've had a client ask for something very similar to this in the past.
Usability Review
Installed fine and understood everything up till when I added the Block Order widget.
There is a field called "Select Regions of Default Theme" with the description reading "Select the regions for reorder the blocks of that regions."
I'm not sure what this means or what regions I should choose. Could the help text be a bit more descriptive here?
As I wasn't sure what to choose here so I just checked "sidebar first" as this was the region that I wanted to alter the order of the blocks in.
Once I'd made this choice I decided to alter the default order of block so dragged one block to the top of the sidebar first region and then clicked on Save settings.
Upon editing the widget again I saw that my default block order had reverted to what it was before I had made my changes. I tried altering the default order again and saving but again my changes were not saved so there is a bug here.
After this I decided to edit an article to try and change the order of the blocks at node level.
The first thing that was a bit confusing was there were more blocks listed in the sidebar first region on the node edit page than there were in the widget settings page. Out of my 5 blocks in that region 3 are set to only show on "Article" content type, and 2 have no content type set. So I can see the reason for the different number of blocks, but feel that this list should be consistent between the widget setting and node setting form.
After saving the node the blocks were correctly re-ordered, however then I edited the node again and this time there were only 3 blocks to re-order. The blocks without a content type set had disappeared from the list.
I then edited a different article and initially it showed all 5 blocks, but then after saving and re-editing the list had cut down to 3 again so there is definitely a bug there.
Code Review
As webmorozov mentioned above on line 69 you are using
$node = (node_load(arg(1)));
however the node is already available as it's been passed in as part of the $form_state array so you can use:
$node = $form_state['node'];
I'm not 100% sure about this but I think you could possibly replace line 67:
if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'edit') {
with:
if (isset($form_state['node'])) {
This would be preferable as the documentation states "Avoid use of this function where possible, as resulting code is hard to read."
Again on line 265 there is extensive use of the arg() function. If possible would be preferable to remove this.
Comment #36
dahousecat CreditAttribution: dahousecat commentedComment #37
Rkumar CreditAttribution: Rkumar commentedHi dahousecat,
yes, its not reordering at field setting level.
i'll revert you soon after fix the points given by you.
Thanks.
Comment #38
Rkumar CreditAttribution: Rkumar commentedHi dahousecat,
Issue has been fixed and also applied changes which you suggested.
Thanks.
Comment #39
dahousecat CreditAttribution: dahousecat commentedHi Rkumar,
Notice: Undefined variable: reorder_array in block_reorder_field_presave() (line 253 of /var/www/test/htdocs/sites/all/modules/block_reorder/block_reorder.module).
Warning: Invalid argument supplied for foreach() in block_reorder_field_presave() (line 253 of /var/www/test/htdocs/sites/all/modules/block_reorder/block_reorder.module).
Notice: Undefined variable: new_order in block_reorder_field_presave() (line 266 of /var/www/test/htdocs/sites/all/modules/block_reorder/block_reorder.module).
Warning: Invalid argument supplied for foreach() in block_reorder_field_widget_form() (line 83 of /var/www/test/htdocs/sites/all/modules/block_reorder/block_reorder.module).
After having saved the node I tried to edit it again and the error has gone away.
Comment #40
dahousecat CreditAttribution: dahousecat commentedComment #41
Rkumar CreditAttribution: Rkumar commentedHi dahousecat,
Thanks for your valuable feedback.
* First two points has been resolved. Ideally if you are adding a field then it must be completely configure. Now you will not face this issue.
* Default setting is also working. Please check.
* Text is added that reorder is possible with in the region.
* In case of validation error, need to do the reorder again. Even message also comes that reorder will not save until form is saved.
validation error refresh the page so that it set to default.
* Now block reorder widget will come only for the nodes.
* I removed that pareview error before your post. :)
Thanks Again.
Comment #42
Rkumar CreditAttribution: Rkumar commentedComment #43
dahousecat CreditAttribution: dahousecat commentedHi Rkumar,
I agree people should ideally fill out all configuration options for a field but users can be dumb and it's good your module can handle these scenarios :)
One minor point is that it is still possible to add a block re-order field to a user or a taxonomy term when it's added from the "Select an existing field" dropdown.
I agree that all other issues are resolved.
Comment #44
klausimanual review:
But that are not critical application blockers, so ...
Thanks for your contribution, Rkumar!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #45
Rkumar CreditAttribution: Rkumar commentedHi dahousecat,
Thanks alot :)
I'll definitely do that in my next commit.
Comment #46
Rkumar CreditAttribution: Rkumar commentedHi klausi,
First, Thank you very much for allowing me to promote my project.
Block reorder gives the option to manage the order of blocks for any node which is not available in panels, context etc. By using Block reorder, order of blocks can be manage for different content types and their nodes which makes it differ from others.
For second, third points, I'll fix them in next commit.
Thanks :)
Comment #47
Rkumar CreditAttribution: Rkumar commentedHi dahousecat & klausi,
Mentioned changes done.
Thanks.
Thanks all for your support and valuable feedback.
Comment #48
Rkumar CreditAttribution: Rkumar commented