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

Julien PHAM’s picture

I 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...

Patrick Nelson’s picture

Julian,

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

Julien PHAM’s picture

Yes, 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

Julien PHAM’s picture

I 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...

Julien PHAM’s picture

Mmmm 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...

Patrick Nelson’s picture

Julien,

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

Julien PHAM’s picture

Thanks, 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...

Julien PHAM’s picture

btw 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

Patrick Nelson’s picture

Yes, use the path module (admin/path) or install the pathauto module.

vincentc’s picture

Hello,

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

  • checkbox
  • file
  • image
  • select
  • textarea
  • textfield
  • timestamp

Contrib Field Types

  • colorpicker
  • email
  • gallery
  • imagegal
  • mp3
  • multiselect
  • number
  • table
  • url
  • usergroup

Note that I haven't tested each an everyone of them. I just had a look at the list of files similar to field_xxx.inc in the flexinode module directory.

Vincent

oscnet’s picture

Version: » master

I have exactly the same problem
any one fixed this?!

karens’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB

I 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.

karens’s picture

StatusFileSize
new37.65 KB

For those who have trouble applying patches, here is the latest cvs with the patch applied.

karens’s picture

Just 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.

Patrick Nelson’s picture

Karen,

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

karens’s picture

StatusFileSize
new1.04 KB

Try 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'.

Patrick Nelson’s picture

Brilliant.

Fast work, Karen. Thanks a lot.

Regards

Patrick

karens’s picture

StatusFileSize
new37.95 KB

OK, 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.

karens’s picture

StatusFileSize
new37.95 KB

I 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.

karens’s picture

StatusFileSize
new2.84 KB

Oops 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.

karens’s picture

StatusFileSize
new3.14 KB

Arrgh! 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.

fago’s picture

Status: Needs review » Closed (duplicate)

-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.

karens’s picture

Status: Closed (duplicate) » Needs review

fago, 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.

fago’s picture

the 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..

karens’s picture

fago,

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.

olet’s picture

still missing work after patched
i use drupal 4.7 CVS [Feb 23th 8:09]

karens’s picture

Which 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?

fago’s picture

StatusFileSize
new618 bytes

the mentioned fapi issue in core has been fixed :)
here an according patch for flexinode, making this work again.

seanr’s picture

What 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.

fago’s picture

use the latest drupal head and latest flexinode with the patch i posted above.
please report wheter you have success.

seanr’s picture

Confirmed working now. Thank you very much!!!

SpriteGF’s picture

Status: Needs review » Reviewed & tested by the community

Thank you so much! I had this problem too and the patch fixed it.

Confirmed working.

port’s picture

Confirmed working.

Thanks!

morbus iff’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Patrick Nelson’s picture

Version: master » 4.6.x-1.x-dev
Status: Closed (fixed) » Needs work

I agree that this WAS fixed but the same problem now seems to be re-occuring (see node 56390. Hence the change in status.

darren oh’s picture

Status: Needs work » Closed (fixed)