Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#439: Should Date and Upload field types be linkable for Select Box Link fields?

I’m not sure why they are not, but it’s tripped me up in the past. Perhaps the team could enlighten.

One example: http://www.getsymphony.com/discuss/thread/473/7/#position-131

[Zimmen] Got it … well … seems like a bug to me! I had a section with only a file upload, a date and a subsection manager field … Those cannot be “bound” by a selectbox-link field so that section doesnt display…

My guess is that the Date and Upload field has no handle column, so that aspect of providing a handle having it resolved to an ID would not work.

That’s probably why the Checkbox field also is not available.

What to do? Sure it could be enabled and if people stick with using ID’s for their Datasources it’d work, but if they don’t, and there is errors…

Should this be left to the developer to manually change the canPrepopulate function for that install?

While my first thought would be YES date, NO files, I think it would be much smarter to keep Symphony as flexible as possible. Writing all of the potential use-case scenarios is a slippery slope.. I would say go ahead and allow both.

The date field is an obvious one, the chrono entry to be chosen. The file field seems a bit more abstract, but consider how banks have you verify an image with a keyword..? That seems like it could have a need for such a 1:1 relationship abstracted from user credentials..?

I would always lean towards : give developers control and see how rad they can be.

Use cases for both:

Dates
I have a section “Events”. An event does not have a title and its human-readable identifier is its date. I want to assign images to an event and want the event date field populating the SBL in my images section.

Files
I have a “Logos” section (for example a list of company logos re-used throughout a website). A logo entry has a File Upload and a Caption text field. In a Company entry I want to choose a logo using a SBL field.

My guess is that the Date and Upload field has no handle column, so that aspect of providing a handle having it resolved to an ID would not work.

But the handle filtering was added relatively recently to the SBL field, but date/upload fields have never been allowed. I think it’s the canPrePopulate function in the field that allows this.

The handle-filtering is a poor implementation in the SBL (in my opinion) because it relies on specific database implementation of a field (a column named handle), rather than class-level abstraction by the specific field. It’s the best we’ve got though, so I’m not complaining. But I wonder whether the handle-filtering of the SBL could be improved to instead look up the field and use its buildDSRetrivalSQL method rather than blindly assume a handle exists.

That’s probably why the Checkbox field also is not available.

I think the Checkbox field isn’t available because it isn’t useful. I can’t think of a use case where you’d want an SBL dropdown populated by a load of “Yes”, “Yes”, “No”, “Yes”, “Yes” etc. But I can think of when a date or a filename would be used.

Should this be left to the developer to manually change the canPrepopulate function for that install?

That’s hacking the core though. My opinion is that the Date and File Upload fields should work without hacking. The problem we have is that the SBL has a hard-coded assumption of a handle field, which it shouldn’t really be making.

I agree with what you have said, just not sure about how we go about implementing this now.

What was your idea about using buildDSRetrivalSQL to help?

Could we simple run a MySQL query to check for the handle column before executing that logic in the SBL field?

Ok, (SBL) commit and (Symphony) commit now allows the SBL to link to Date and Upload fields.

The solution is to just catch the Exception from the SQL call that queries for handle. I figured this is the best solution as it prevents have to making an additional query to determine if the handle column exists. It’s not ideal, because it’s still going to perform one query for each entry that the SBL is linked to, but I think it’s the best we can do at the moment.

This issue is closed.

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