File Selector in Dashboard not working

Permalink
I've got a package which doesn't work on the latest released version 5.3.3.1 but it does on svn and I just wonder whether this is a bug or not..

I'm using this code in a dashboard extension:

$al = Loader::helper('concrete/asset_library');
echo $al->image('ccm-b-image', 'fID', t('Choose Image'), $bf);


On the svn site I get this code:
<a onclick="ccm_chooseAsset=false; ccm_alLaunchSelectorFileManager('ccm-b-image')" href="javascript:void(0)">Choose Image</a>


but on 5.3.3.1 I get this:
<a class="ccm-file-manager-launch" onclick="ccm_chooseAsset=false" href="javascript:void(0)">Bild auswählen</a>


any hints?

Remo
 
Remo replied on at Permalink Reply
Remo
couldn't wait and had to look a bit closer.. Looks like there's a bug in the released version which has been fixed in svn

in helpers/concrete/asset_library.php
line 49 should be:
$html .= '<a href="javascript:void(0)" onclick="ccm_chooseAsset=false; ccm_alLaunchSelectorFileManager(\'' . $id . '\')">' . $chooseText . '</a>';
lphillips replied on at Permalink Reply
lphillips
Good find. Definately needs fixing for the next release. i tried to override the helper by creating concrete/asset_library in my helpers directory and that resulted in white screening.

Not enough time to follow up - So keep in mind.
olacom replied on at Permalink Reply
olacom
Is this issue resolved?
Remo replied on at Permalink Reply
Remo
it was already fixed in svn when I posted the first message.
olacom replied on at Permalink Reply
olacom
I'm unable to make the User file attribute work. I see the select file link in the edit user profile but it doesn't do anything when clicked. When I view the public profile it says:


Fatal error: Call to a member function getDownloadURL() on a non-object in /home/outaouai/public_html/concrete/models/attribute/types/image_file/controller.php on line 19



Do you have any ideas of why it does that?
olacom replied on at Permalink Reply 1 Attachment
olacom
See video attached
mose replied on at Permalink Reply
mose
What is the code behind the "Choose File" link?
olacom replied on at Permalink Reply
olacom
<script type="text/javascript">
var ccmAttributeTypeSelectHelper={  
   add:function(akID, field){
      var newRow=document.createElement('div');
      newRow.className='newAttrValueRow';
      newRow.innerHTML='
<input name="' + field + '" type="text" value="" />
';
      newRow.innerHTML+='<a onclick="ccmAttributeTypeSelectHelper.remove(this)" href="javascript:void(0)">[X]</a>';
      $('#newAttrValueRows'+akID).append(newRow);            
   },
   remove:function(a){
      $(a.parentNode).remove();         
   }
}
ScottC replied on at Permalink Reply
ScottC
not that it really matters at this point, but when this was put into a singlepage you needed to manually call ccm_activateFileSelectors(camelcase might be wrong there);

so ccm_activateFileSelectors(); in a jquery document ready function.

Thanks to mirv for that one.
olacom replied on at Permalink Reply
olacom
ScottC: I'm using the default single_page/profile/edit.php of conrete5. Is it supposed to work by default ?

I added ccm_activateFileSelectors(); in a document ready but it doesn't make any difference.

Thanks for help.
ScottC replied on at Permalink Reply
ScottC
to be totally honest, i am not sure. My only interactions with this situation are through the blog app(under dashboard so everything under the "concrete5 sun" is loaded there, or through a block add/edit, where again everything is loaded.

I haven't actually loaded these in a standard non-dashboard or block add/edit form so I can't speak from personal experience as to why this wouldn't work aside from making sure the controller that is associated with this single page is loading via its on start method whatever ccm or otherwise js is associated and thus makes available this function.
olacom replied on at Permalink Reply
olacom
I did a test and included everything js and css. And it worked, with some little bugs but in general.

So nothing load for REGISTRATED group users ?

I tought that everything is always loaded properly when <?php Loader::element('header_required'); ?> is added.
ScottC replied on at Permalink Reply
ScottC
not necessarily, it depends on if it is under /dashboard/ and this it has an entirely independent header and theme and all of that. That is the scope of my experience with this, haven't dealt outside of this, honestly i haven't looked at profiles..ever :(
gelie replied on at Permalink Reply
gelie
Has there been a solution to this bug yet?
EDIT: apparently it works in the .4 version
andrew replied on at Permalink Reply
andrew
Yes, this is fixed in 5.4.