CMS MADE SIMPLE FORGE

ListItExtended XDefs

 

[#8982] GBFilepicker isn't working with {$item_id} and {$item_alias}

avatar
Created By: Nik (NikNak)
Date Submitted: Tue Feb 26 08:43:14 -0500 2013

Assigned To: Tapio Löytty (Stikki)
Version: 1.1
CMSMS Version: None
Severity: Minor
Resolution: Won't Fix
State: Open
Summary:
GBFilepicker isn't working with {$item_id} and {$item_alias}
Detailed Description:
Hi

I posted this as a bug for GBFilepicker but I think it is probably more likely a
problem here (not sure)
http://dev.cmsmadesimple.org/bug/view/8978


In the Listit2 upload field definition for GBFilepicker, it says:
Directory path that will be appended to $config['uploads_url'] . No slash at the
end. {$item_id} and {$item_alias} will be replaced.

If you try to use {$item_id} in this field however, then in Listit2 when you go
to edit an item, in place of the upload field is the error '-- Missing
Languagestring - module:ListIt2XDefs string:pathcontainsvars--'


Many thanks
Nik


History

Comments
avatar
Date: 2013-05-29 22:25
Posted By: Prue Rowland (psy)

Had the same problem.  Solution is in 3 parts, ie:

1. Do not use {item_alias}.  This returns the alias of the fieldname, not the
item alias

2. Change "if(!isset($item_id) || !is_int($item_id))" to "if(!isset($item_id) ||
$item_id == -1)" in the _CompileExtraDir function.

3. Add $lang['fielddef_GBFP_pathcontainsvars'] to ListIt2XDefs/lang/en_US.php or
whatever language file you are using.


      
avatar
Date: 2013-05-29 22:28
Posted By: Prue Rowland (psy)


Change point 3 to:

3. Add $lang['pathcontainsvars'] to ListIt2XDefs/lang/en_US.php or
whatever language file you are using.
      
avatar
Date: 2013-05-30 04:07
Posted By: Nik (NikNak)

Thanks Prue

I think this feature is being removed though - see
http://dev.cmsmadesimple.org/bug/view/9212

Many thanks for posting this.

Regards
Nik
      
avatar
Date: 2013-07-06 07:59
Posted By: Tapio Löytty (Stikki)

This feature is now removed due complexity of field and even if i want to look
this matter from angle where this exists, it's still 50% solution, not what i
wanted.

As i can't really intercept with GBFilePicker rendering process, only suggestion
is what psy said above, but i don't like that you have to save item first to be
able to add files to it. Might be that i change my mind later on if i come up
with better approach.

This feature is in new field: FileUpload, so if you need directory based upload
field, then use that instead.

Feel free to fork this field and present valid solution how to get around this
issue, i'll reconsider whole thing in that case.

Case closed.
      
Updates

Updated: 2013-07-06 08:00
resolution_id: => 8
cmsms_version_id: 29887 => -1