Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have following custom table
INSERT INTO `exposed` (`id`, `name`, `deadline`, `node_id`)
VALUES
(1, 'Danny', 1399477939, 1),
(2, 'Peter', 1399477957, 2);
and this table is exposed in views using hook_views_data(). read:http://www.sitepoint.com/exposing-tables-views-drupal-7/
Now I want to integrate this view table with EditableViews module. When I integrate I don't see (editable) lable in any of the above table fields.
As a summary, How do I use editableviews with my custom tables (non entity)
Comment | File | Size | Author |
---|---|---|---|
#2 | empty fields.PNG | 179.48 KB | adhisugha |
Comments
Comment #1
joachim CreditAttribution: joachim commentedYou need to either:
- declare your table, and then declare its properties to Entity API metadata
- declare your fields as editable to hook_views_data, and probably create custom handler classes for them
Comment #2
adhisugha CreditAttribution: adhisugha commentedThanks. I am trying option1.
I dont see the fields in "Metadata property" drop down while I try to add editable fields in my view.
Following is the code.
Comment #3
adhisugha CreditAttribution: adhisugha commentedHere is the basic working for integrating custom table with editable views. The entity type and bundle name is 'exposed'. I have not done anything for deleting entity. But this works fine for Save.
CREATE TABLE `exposed` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key of the record.',
`name` varchar(255) DEFAULT NULL COMMENT 'A simple text field.',
`deadline` int(11) DEFAULT NULL COMMENT 'A date stored as an integer timestamp.',
`node_id` int(11) DEFAULT NULL COMMENT 'A Drupal node related to this record.',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='The base table for the information we want exposed to Views.'
exposed.module
============
exposed.views.inc
==============
Comment #5
kumarAbhi CreditAttribution: kumarAbhi commentedComment #6
kumarAbhi CreditAttribution: kumarAbhi as a volunteer and commentedComment #7
kumarAbhi CreditAttribution: kumarAbhi as a volunteer and commentedhi all
after coding with above example i am not getting the enabled expose module in add new views and view page what is cause of it try to help me fix this issue