I'm sorry if this isn't a bug but rather a request for a feature. I'm not sure where interactions between modules fits in there.
I have installed Sheetnode and been using it with great success. I would like to add taxonomy tags to the nodes for the purpose of finer grained access permissions.
When I set up my taxonomy, if I make the vocabulary required, I can't use the "Sheetnode import from template functionality". When I try I get an error message, "Taxonomy Stuff field is required". Taxonomy Stuff is the name of my vocabulary. Below that it says "The requested page could not be found." which makes sense as the url is http://localhost/drupal-6.8/?q=node//edit.
I've started looking through the code but I'm a hobbyist at best when it comes to programming and I'm new to Drupal. So I'm hoping maybe I could get help in tracking this down and getting it fixed. I'll help as much as I can to get it done.
This is a great module, thanks so much for making it available.
Comments
Comment #1
infojunkieThanks for a great catch! The fix I am considering is to clone the node attributes of the template in the target spreadsheet. This should then work transparently for taxonomies and any other node attribute. I unfortunately won't be able to work on this before next week.
Comment #2
stoolpigeon commentedThat's great - thank you. I will keep an eye out for it.
Comment #3
infojunkieI just committed a fix to this issue. I had to design a generic fix, not one that would just work for taxonomies. Here's how I did it:
When the module is about to create a new Sheetnode out of a template, it fires a
hook_sheetnode_template_altercall to allow any 3rd party module to extend the node creation parameters with whatever data is required. This way, Sheetnode doesn't have to guess which fields are required and which aren't.I tested this fix with a required vocabulary on Sheetnodes, as in the original report. Here's my code to supply the required taxonomy terms to the node about to be created, based on a new template field 'vid' that holds a reference to the node from which this template was created. My code just copies all terms from that original node into the new node's form_state.
Note that this code is for illustration only. In particular, multiple-valued taxonomies and tags will not work correctly.
Please test this fix 12 hours from now. You will need to run a database update.
Comment #5
sgpopuri commentedI also faced this problem but when I try to import a excel file. The error message was not very clear and it only says "sheetnode field is required".
When I unmarked the taxonomy term as not required, I was able to import the file.
Comment #6
infojunkieI adapted the solution above to all import mechanisms, with a little modification. To use it, you need to implement
hook_sheetnode_alter(&$form_state_node, $form, $form_state)as described in #3 above. The different is that I changed the hook name and removed the$templateparameter.Please download the latest dev release to try it (12 hours from now) and let me know if it works for you!
Comment #7
infojunkie