Hi,
I have a table to store geo-location data which is related to articles like this:
DROP TABLE IF EXISTS `jos_content_geo`;
CREATE TABLE IF NOT EXISTS `jos_content_geo` (
`auto_id` int(11) NOT NULL,
`id` int(11) NOT NULL,
`type` varchar(7) NOT NULL,
`zone_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `jos_content_geo` (`auto_id`, `id`, `type`, `zone_id`) VALUES
(1, 2605, 'Excl', 101);
To manage this from within an article, I have created the following fields:
Geo Rule Type
Geo Zone
#__zone is:
CREATE TABLE IF NOT EXISTS `jos_zone` (
`zone_id` int(11) NOT NULL,
`zone_name` varchar(255) DEFAULT NULL,
`zone_description` text NOT NULL,
`zone_substitute` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=114 ;
INSERT INTO `jos_zone` (`zone_id`, `zone_name`, `zone_description`, `zone_substitute`) VALUES
(101, 'North & Central America', 'Substitude: USA', 223),
(102, 'South America', 'Substitude: Brazil', 30),
(103, 'Africa', 'Substitude: South Africa', 193),
(104, 'Middle East', 'Substitude: United Arab Emirates', 221),
(105, 'Europe - British Isles', 'Substitude: Great Britain / UK', 222),
(106, 'Europe - French', 'Substitude: France', 73),
(107, 'Europe - German', 'Substitude: Germany', 81),
(108, 'Europe - Spain', 'Substitude: Spain', 195),
(109, 'Europe - Russian', 'Substitude: Russia', 176),
(110, 'Europe - Other', 'Substitude: Italy', 105),
(111, 'Asia', 'Substitude: Hong Kong', 96),
(112, 'Pacific', 'Substitude: Australia', 13),
(113, 'New Zealand', 'Substitude: New Zealand', 153);
CREATE TABLE IF NOT EXISTS `jos_zone` (
`zone_id` int(11) NOT NULL,
`zone_name` varchar(255) DEFAULT NULL,
`zone_description` text NOT NULL,
`zone_substitute` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=114 ;
--
-- Dumping data for table `jos_zone`
--
INSERT INTO `jos_zone` (`zone_id`, `zone_name`, `zone_description`, `zone_substitute`) VALUES
(101, 'North & Central America', 'Substitude: USA', 223),
(102, 'South America', 'Substitude: Brazil', 30),
(103, 'Africa', 'Substitude: South Africa', 193),
(104, 'Middle East', 'Substitude: United Arab Emirates', 221),
(105, 'Europe - British Isles', 'Substitude: Great Britain / UK', 222),
(106, 'Europe - French', 'Substitude: France', 73),
(107, 'Europe - German', 'Substitude: Germany', 81),
(108, 'Europe - Spain', 'Substitude: Spain', 195),
(109, 'Europe - Russian', 'Substitude: Russia', 176),
(110, 'Europe - Other', 'Substitude: Italy', 105),
(111, 'Asia', 'Substitude: Hong Kong', 96),
(112, 'Pacific', 'Substitude: Australia', 13),
(113, 'New Zealand', 'Substitude: New Zealand', 153);Then I created a Content type Geo Rule:
And created a Group X field to insert it into Content:
For the storage method I was not sure what to enter, but I found whatever I enter,
- Format / Object gets changed to Standard / Free / geo_rule
- Parameters is changed to jos_cck_store_item_content_geo
I'm assuming this is correct, as it happens automatically.
I have then added a tab and the Group X field to the default Article template.
The tab and the field is shown, and it shows the correct already existing data (1 record). When I change the database data, the display changes accordingly.
However, I cannot add another entry, it is simply not saved. I also found when inspecting the HTML of the form that the first entry includes: <input type="hidden" id="geo_rule_0_art_id" name="geo_rule[0][art_id]" value="2605">, whereas the 2nd one does not include this when added.
One other odd thing is that when default number of items for the Group X field is 0, I can'd add an item.
What am I missing/ doing wrong?