Drupal 以编程方式删除节点类型和/或 cck 字段
我的自定义模块创建一个带有一些 CCK 字段的节点类型。
当用户卸载时,我需要删除 CCK 字段,以便旧的 CCK 出现不会干扰重新安装模块时要创建的新 CCK 字段。
我正在尝试以下代码:
function mymodule_uninstall(){
content_field_instance_delete('field_ccktest', 'my-node-type', FALSE);
}
但是 content_field_instance_delete 锥体返回一个无法识别的函数。
My custom module creates a node type with a few CCK fields.
When the users un-installs, I need the CCK fields to be deleted so the old CCK occurances don't interfere with the new ones to be created should the module be re-installed.
I am trying the following code:
function mymodule_uninstall(){
content_field_instance_delete('field_ccktest', 'my-node-type', FALSE);
}
But the content_field_instance_delete cones back with a function not recognized.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CCK 的 CRUD 函数位于默认情况下不包含在 Drupal 引导程序中的文件中,您只需将其包含在函数中即可:
CCK's CRUD functions live in a file that isn't included by default in the Drupal bootstrap, you just need to include it in your function: