Project Page and Repository
http://drupal.org/sandbox/drupwas/1679826
git clone http://git.drupal.org/sandbox/drupwas/1679826.git blockexport
Drupal Version: 7x
Functionality List
- It will import all system specific block into a feature.
- Import all custom blocks within a feature.
- Import all system blocks associated with content type
- Import all block roles
- No configuration is required.
- This module not create any table in your database to minimise the performance issue
Different from others module
- It not created any tables due to increase the performance.
- Other module have a issue with features(not reverted) and need to configure lots of thing in admin panel.
Installation
Quite simple, Download the module and simply put into your
your_drupal_path/sites/all/modules and install from your admin panel.
Configuration
After successfull installation you able to export your all local box from
Admin >> Structure >> Features >> Create Features
Enter your features name, description, package(optional),
version(optional), URL(optional) and then choose "Block: blockexport_settings"
from edit components drop-down box and then should check
"Block: Export All Blocks" checkbox and then press download button.
Unzip your downloaded file and upload it into your drupal installed remote
server or in any vanila drupal(drupal_root/sites/all/modules) where you want
to import all the exported blocks and enable this module by drush or
from admin.
That's it.
Dependencies
- Features (http://drupal.org/project/features)
- Ctools (http://drupal.org/project/ctools)
Reviews of other projects
http://drupal.org/node/1684418#comment-6235206
http://drupal.org/node/1098972#comment-6227860
http://drupal.org/node/1102520#comment-6236572
http://drupal.org/node/1673410#comment-6269734
http://drupal.org/node/1682266#comment-6273306
http://drupal.org/node/1679472#comment-6273512
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | export_blocks.png | 97.57 KB | bartlantz |
Comments
Comment #0.0
drupwash commentedDifferent from others module html property changed
Comment #0.1
drupwash commentedCode script removed
Comment #0.2
drupwash commentedRepository explanation provided
Comment #0.3
drupwash commentedDescription modified
Comment #0.4
drupwash commentedClean repository address added
Comment #1
eleonelThis module export all the blocks? or only selected blocks?
Good idea!
Comment #2
klausiYou have listed some reviews in your issue summary, but you did not do any manual reviews? Please read through the source code of other projects and report any issues that you find. And don't forget to add the review bonus tag if you did some actual manual reviews as outlined in #1410826: [META] Review bonus.
Comment #3
drupwash commented@eleonel, thanks a lot to review, right now it port into a feature with all the blocks and I'm working on to feature selected block without creating any extra table.
Comment #4
drupwash commented@klausi, thanks a lot, I will follow, which you mention, it is very use-full. Thanks again.
Comment #4.0
drupwash commentedVersion added
Comment #4.1
drupwash commentedReview msg changed
Comment #4.2
drupwash commentedReview added
Comment #4.3
drupwash commentedReview added
Comment #4.4
drupwash commentedReview comments added.
Comment #5
drupwash commentedNeeds Review
Comment #6
bartlantz commentedHi @drupwash,
This is a great module, very handy! I was able to export all of the blocks from a test site and to import them back into the site. Everything is working correctly.
These are my suggestions for improving it:
1. Add a better description to the block_export.info. For instance:
description: Allows exporting of all blocks as a feature.
2. Add a requirements section to the README.txt for the requirements: Features and Chaos Tools.
3. Add to README.txt that you should check "Block: Export All Blocks" when creating the feature.
4. Add a couple screen shots to the project page. (Creating features can be confusing to end users so a screen shot could help illustrate instructions.) I've attached a picture of the create features page.
Thanks,
Bart
Comment #7
bartlantz commentedI changed the status back to "needs review", because the module works as intended but could just use a couple of documentation fixes. These minor things shouldn't block others from reviewing the module.
Thanks,
Bart
Comment #8
roynilanjan commentedI have gone through the code base it actually works on entire block tables.
As far codes it seems to me very handy module but have one suggestion,
In the blockexport_settings_features_export_render function there are multiple quires to take the all block configuration.
Mostly common queries excepts those table & schema name so please make a class in .inc file
& put the logic in parameterised static function,
$results = db_query("SELECT * FROM ".$schema_name);
foreach ($results as $result) {
$data = array();
$schema = drupal_get_schema($schema_name);
$fields = array_keys($schema['fields']);
foreach ($fields as $field) {
$data[$field] = $result->$field;
}
$code[] = " \$export['$schema_name'][] = " . features_var_export($data) . ";";
}
load the module in info file & then call the function in module like,
Blockexport::methodname('schemaname');
Comment #8.0
roynilanjan commentedRepository added
Comment #9
drupwash commentedHi @bartlantz,
Thanks for your reply. I have added following things as per your suggestions..
1. Better description added into .info file
2. Dependency description added into README.txt file.
3. Added into README.txt that you should check "Block: Export All Blocks" when creating the feature.
4. Screen-shot and better description added into features page.
Comment #10
drupwash commentedHi @bartlantz,
Thanks for your reply. I have added better documentation in features page as well as in readme.txt also.
Comment #11
drupwash commentedHi @roynilanjan,
Thanks a lot for reviewing my code. This is good idea to make a separate class in a .inc file but I have a very minimal code and business logic in .module file and I think it will better to create a private function in .module file instead of class in new .inc file.
I have created following function from your suggestion instead of creating class in .inc file
Comment #11.0
drupwash commentedContent modified
Comment #11.1
drupwash commentedRepository added
Comment #11.2
drupwash commentedRepo modified
Comment #11.3
drupwash commentedVersion added
Comment #11.4
drupwash commentedReview added
Comment #11.5
drupwash commentedReview added
Comment #12
drupwash commentedHi @klausi,
I would like if you test my code again or any suggestion appreciated that why I'm not get reviewed by others though I have already reviewed other codes. Thanks in advance.
Comment #13
klausiOnly reviewers should assign issues to themselves.
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
manual review:
Anyway, I find the idea to just dump whole database tables into Features export code kind of creative :-) . Looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #14
mitchell commentedThanks for your contribution, drupwash!
I updated your account to let you 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 again, and good luck! :)
Comment #15
drupwash commentedThank you very much @klausi and @mitchell for reviewing code and for full project access.
@Klausi I will modify my code as per your suggestions.
Comment #16
drupwash commentedHi @klausi,
Could you give me any suggestion or anything wrong from my-side that I'm not able to seen any downloadable .zip or .tar file in my project page though I have already moved project from sandbox to "Full Project". Thanks in advance.
Comment #17
klausiSee http://drupal.org/node/1068944
Comment #18
drupwash commentedHi @klausi,
Thanks for your reply. Could you guide me why I have access denied(http://drupal.org/node/add/project_release/1679826) page? when I'm trying to add new release from my project page.
Comment #19
drupwash commentedHi @klausi,
Thanks for your reply. Could you guide me why I have access denied(http://drupal.org/node/add/project_release/1679826) page? when I'm trying to add new release from my project page.
Comment #20
patrickd commentedeveryone gets this at the moment, probably site-maintenance.
Comment #21.0
(not verified) commentedReview added