4 users online. Create an account or sign in to join them.Users
Unique link field
This is an open discussion with 9 replies, filed under Extensions.
Search
Been thinking about this field a little, does it currently allow the code to be reset or changed after a preset period of time? i.e for 24hrs the code is the same but once the 24hrs are up it re-generates a different code so the URL is always available but changes after the preset amount of time?
This looks really useful. Could you activate the code based on a user interaction?
@moonoo2: The field doesn't auto-generate or change it's code. Once the period of time has passed, the entry (and therefore the code) will be deleted.
@muthahubbard: I could imagine you create an event that creates an entry which generates a code. I haven't tested it or can think of any examples on how to do this, but in theory you could do something like:
- User fires an event (posts a form for example).
- Entry is created with unique code.
- In your event the ID of the created entry is returned. (Or perhaps the code itself, don't know about that).
- You can use this ID to retrieve the entry with the code in a datasource.
- You can use this datasource to generate a link on screen or in a e-mail or something.
Once again: This is only the theory, I could imagine you might bump into some interesting stuff on point 4.
I am trying to use it on Symphony 2.2.5 and I get an error... Extension Installs fine, but this happens when I try to include it in a a section:
Key column 'value' doesn't exist in table An error occurred while attempting to execute the following query CREATE TABLE IF NOT EXISTS `sym_entries_data_96` ( `id` int(11) unsigned NOT NULL auto_increment, `entry_id` int(11) unsigned NOT NULL, `code` varchar(255) default NULL, `timestamp` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `entry_id` (`entry_id`), KEY `value` (`value`) ) ENGINE=MyISAM;
Any idea what might be causing this and how to solve it?
Here's how I fixed it:
---Removed---
Nah. It did not work. I still now need ideas how to solve this.
Looks like the extensions tries to add a key in the database table for a column that does not exist. See line 315 in field.unique_link.php. Try removing this line or changing value to code.
I removed the Key column and now I can create section with this field as well as entries, but when I create a Data Source and try to filter the actual code field using $mycodeparam, I get another error:
<error>MySQL Error (1054): Unknown column 't111_1.value' in 'where clause' in query "SELECT SQL_CACHE `e`.id,
`e`.section_id, e.`author_id`,
UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`
FROM `sym_entries` AS `e`
LEFT JOIN
`sym_entries_data_111` AS t111_1
ON (e.id = t111_1.entry_id)
WHERE 1
AND `e`.`section_id` = '20'
AND (
t111_1.value IN ('d448c90f4a9a65850d5ded34f82a228431cda92f')
OR t111_1.handle IN ('d448c90f4a9a65850d5ded34f82a228431cda92f')
)
ORDER BY `e`.`id`DESC"</error>
However, if I remove the filtering, the entries show up nicely in my debut console...
Hm, in the SQL generating methods (buildSortingSQL() and buildDSRetrievalSQL() are references to handle and value columns. Appears to me that those are copied from som other extensions implementation. Chnaging those to use the code should help. My guess it that the extension generally is not used to filter data sources, so that those queries never get generated.
Unique link field updated to version 1.1 on 15th of May 2012
- Updated for S2.3
Create an account or sign in to comment.
A new extension, "Unique link field" is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.