Fresh install of 4.7-HEAD with flexinode from cvs as of 14/2/06 (module version 1.64).
Try creating a new content type and then adding a field. The fields no longer appear in the field list. They are created in the MySQL table but the following fields do not have the correct values stored in them thus dis-associating (or never associating them in the first place) with their respective flexinode type:
ctype_id - stores 0
field_type - blank
The attached screenshot shows this from my web server control panel.
Don't know if the problem is caused by recent changes in HEAD or a fault with flexinode. If I had to guess, I would say it was HEAD.
Comments
Comment #1
Julien PHAM commentedI have exactly the same problem with cvs version of drupal and flexinode... a big problem as I really need flexinode to replace the included story content...
Comment #2
Patrick Nelson commentedJulian,
I've been temporarily hacking the fields into the backend database until the guys that know their stuff find time to get flexinode updated.
I think it's worth being patient - flexinode is an excellent module - it's just that the Drupal developers are probably up to their necks with patches, etc., not to mention their own lives.
Anyway, if you want me to publish a rundown on how to hack the flexinode tables, let me know.
Regards
Patrick
Comment #3
Julien PHAM commentedYes, I would like to... because I don't want to use stories or pages for my articles, I would like to use a flexinode type called articles, with a title and a second title... and I need to start creating some articles, and I cannot do this with stories, because if I do so, I'll have to copy all my articles in the flexinode when it will be available... a long work...
Thanks
Comment #4
Julien PHAM commentedI found how to fix it, once I created the fields, I went into mysql administration and I modified the ctype_id for the correct ctype_id of my node.
Too bad dba does not work for this (I get a Call to undefined function: form_textfield() error message while trying to edit a field), I have to do this with phpmyadmin...
Comment #5
Julien PHAM commentedMmmm I spoke too fast, now I get the following warning message when I try to create a content, and impossible to create it :
Invalid argument supplied for foreach() à la ligne 578 du fichier /homepages/23/d154239500/htdocs/min/modules/flexinode/flexinode.module.
I must have missed something...
Comment #6
Patrick Nelson commentedJulien,
Yeah, you need to set the "field type" as well - textarea, select, etc.
Also, depending on the "field type", you may also need to change some of the other fields.
The best way to do it is set the ctype and field type as you have been doing, then go back to your content editing page (admin/node/types in 4.7) and refresh.
The field should then appear in the list but to make it work properly, you should go in and edit it just as you would a normal field. For example, if you made the "field type" as a select field, you would go in and edit it and add the choices that are in your select field via the normal admin/node/types interface.
This will work because once the ctype and field type have been set, the d/b seems to hang onto them and associate them with the correct flexinode content type.
For a list of different field types, you should be able to find them by browsing through the module code but if you have problems, let me know and I'll try and post up a list (bear in mind that some of the contrib field types still don't work in flexinode)
Regards
Patrick
Comment #7
Julien PHAM commentedThanks, I just figured this out...
You know, I just need a title, a subtitle, and a text area for my articles, so really I doubt flexinode will not handle this...
Comment #8
Julien PHAM commentedbtw isn't it possible to "name" a flexinode?
I mean, to go to the url (for instance) :
http://min.lledrith.info/?q=node/add/article
Instead of :
http://min.lledrith.info/?q=node/add/flexinode-4
Comment #9
Patrick Nelson commentedYes, use the path module (admin/path) or install the pathauto module.
Comment #10
vincentc commentedHello,
Thank you Patrick and Julien. I happen to have the exact same problem as you two and your messages here have been of great assistance.
I tought I'd contribute by posting a list of field types supported by flexinode (as Patrick suggested) :
Core Field Types
Contrib Field Types
Note that I haven't tested each an everyone of them. I just had a look at the list of files similar to in the flexinode module directory.
Vincent
Comment #11
oscnet commentedI have exactly the same problem
any one fixed this?!
Comment #12
karens commentedI found a fix after a bit of work. There were two problems. One was the form not pulling in the correct hidden values from the post and one was a call to flexinode_field_select() which overwrote the right values when I fixed the first problem.
I just commented out the call to flexinode_field_select() since I'm sure there must be some reason why it's there, but the code seems to work correctly if I take it out.
Comment #13
karens commentedFor those who have trouble applying patches, here is the latest cvs with the patch applied.
Comment #14
karens commentedJust one more thing. If you added new fields while this was broken the fields will still be wrong until you delete or fix them. You'll have to manually fix the fields in the database as noted earlier in the post if you want to keep them. The bad records are in the table flexinode_field and they need both ctype_id (your flexinode content type id) and fieldtype updated. The easiest course would be to delete them in the database, then go back to the administration screen and add them again.
Comment #15
Patrick Nelson commentedKaren,
Thanks for the patch. It works really well. The only field type that doesn't seem to work is the 'dropdown menu' type.
You can enter terms in the select field and pipe-delimit them but if you go back into the field, they have disappeared.
Any ideas for a fix?
Regards
Patrick
Comment #16
karens commentedTry this patch for field_select.inc
It had the values stored correctly in the database, but was not pulling them out into the form. While I was in there I fixed a typo in the spelling of the word 'carriage'.
Comment #17
Patrick Nelson commentedBrilliant.
Fast work, Karen. Thanks a lot.
Regards
Patrick
Comment #18
karens commentedOK, found out what that other function was in there for (the one I commented out). It was needed for multiselect to work. I have fixed multiselect so it works in 4.7 and adjusted my previous patch to accomodate it. This should replace the patch I previously submitted for flexinode.module.
Comment #19
karens commentedI am attaching here a patched copy of flexinode for anyone who is patch-challenged. It has all the patches to the flexinode module that I posted on this page -- the ones that make it possible to add fields in 4.7.
If anyone needs it, I also posted a patch for multiselect to work in 4.7 at http://drupal.org/node/46343.
Comment #20
karens commentedOops again. I see that I posted two copies of the patched module instead of a copy of the patch and a copy of the patched module. I'll try again. Here is the patch.
Comment #21
karens commentedArrgh! I was right the first time about the call to flexinode_field_select. It has to be commented out or it breaks everything else. Multiselect seems to work without it now that I have all the fixes done on that field type. As I look at it more, I think it is related to the old form processing and is not needed under the new form API. Program seems to work for any field that I have tried if I leave it out but it invariable breaks everything if I leave it in.
Another patch, commenting that field back out again.
Comment #22
fago-1 for this fix by don't using the formapi.
this is duplicate of http://drupal.org/node/49799, so i mark it as duplicate.
Comment #23
karens commentedfago, This is not a duplicate and is not even related to the issue you linked it to. There is no use of drupal_goto() in this problem or in this patch. The api problem I was referring to is a place in the code when you add a field and it calls an internal function that was used in the older version but which makes makes the program fail in the new version.
The problem is not the new form api, which works fine, it is that the code had a lot of leftover stuff from the old form processing that needed to be cleaned up.
This needs to remain marked as a patch. You cannot add new fields to a flexinode in the cvs version without this patch.
Comment #24
fagothe drupal_goto() is called from the formapi on submit. pls read the issue.
as i posted in the other issue: fixing it, fixed this issue, too.
further, i discovered the formapi issue by investigating this issue.
sry, for posting this that late to this issue..
Comment #25
karens commentedfago,
sorry, I probably didn't read it closely enough and I see the connection now. I just spent the last day and a half rewriting various flexinode modules to get them functional so I could use them, so I'm probably a bit touchy :-)
Just to clarify for anyone else following this thread, at this point flexinode's ability to add fields will be broken unless someone applies the patch to core that can be found at that link, right? The other thing is, I am pretty sure by now that the function that is creating the problem should not be called at all (the line I tried to comment out), which also fixes the problem.
I submitted patches for several other flexinode modules. I'll take a look, but I don't think any of them are related to this issue. They are mostly about getting 4.6 forms functions rewritten to use the new api.
Comment #26
olet commentedstill missing work after patched
i use drupal 4.7 CVS [Feb 23th 8:09]
Comment #27
karens commentedWhich patch did you apply? Are you saying you tried to add a field and it wasn't saved? What type of field were you trying to create?
Comment #28
fagothe mentioned fapi issue in core has been fixed :)
here an according patch for flexinode, making this work again.
Comment #29
seanrWhat precisely (and in what order) needs to be done to get this working in the latest CVS version of everything? I'm having the same problem and need a workaround ASAP.
Comment #30
fagouse the latest drupal head and latest flexinode with the patch i posted above.
please report wheter you have success.
Comment #31
seanrConfirmed working now. Thank you very much!!!
Comment #32
SpriteGF commentedThank you so much! I had this problem too and the patch fixed it.
Confirmed working.
Comment #33
port commentedConfirmed working.
Thanks!
Comment #34
morbus iffCommitted.
Comment #35
(not verified) commentedComment #36
Patrick Nelson commentedI agree that this WAS fixed but the same problem now seems to be re-occuring (see node 56390. Hence the change in status.
Comment #37
darren oh