Search

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.

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:

  1. User fires an event (posts a form for example).
  2. Entry is created with unique code.
  3. In your event the ID of the created entry is returned. (Or perhaps the code itself, don't know about that).
  4. You can use this ID to retrieve the entry with the code in a datasource.
  5. 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

I am having trouble with this extension:

I created a section for Invites... Then I created an Event and attached it to a page for people to request invites. This is where it breaks. There seems to be a problem saving entries in the front end. Something about the timestamp!? Any help?

At the back-end everything works just fine. The code is created and entry is saved.

Could this extension be used as a basis for a one use only url? i.e once this page is accessed and an event triggered to change a checkbox to expire the url?

Thinking of a one time discount code URL or something?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details