Jump to content

[SOLVED] File (field) description only visible on page when logged as admin


TLT
 Share

Recommended Posts

Hello again. I have a silly problem.

I feel a bit ashamed, really, but I have been searching for some time now, and I can't seem to find the issue. :undecided:

I have a simple site (first one I made with PW, actually), with a "file" field on a "news" template/page. So the webmaster can add a downloadable file to his news.

It works fine, actually, but the field description, which should appear on the page, doesnt show up for guests. It does, as long as I am connected as an admin. But guest users (visitors) can't see it. No text is rendered. (the link itself is working.)

I get the same result on local and distant site.

I dont get it. Have I missed a permission setting or something ?

The code for rendering the link is as follow :

$fichiers=wire("page")->fichier;
    foreach ($fichiers as $fichier) {
        echo "<div class='fichier'><p><b>Télécharger : </b><a href='{$fichier->url}' class='document'>{$fichier->description}</a></p></div>";

When connected as an admin, this outputs, for example, the following code :

<div class="fichier">

<p>
<b>Télécharger : </b>
<a class="document" href="/site/assets/files/1043/inscription_ballade_des_bielles_2015_1.pdf">Inscription Ballade des bielles 2015.pdf</a>
</p>
</div>
 
However, for a guest, the result is :
<div class="fichier">
<p>
<b>Télécharger : </b>
<a class="document" href="/site/assets/files/1043/inscription_ballade_des_bielles_2015_1.pdf"></a>
</p>
</div>
Whatever I do.

:'(

In the DB, the description is stored as :

{"0":"","1021":"Inscription Ballade des bielles 2015.pdf"}

I have probably missed a simple setting somewhere about permissions. But I can't seem to find it. Maybe I'm just slow-brained today...

Help ?

Please ? :-*

Link to comment
Share on other sites

Ooops. Sorry. I did search the forums, but being completely blinded by the "file field" aspect, I completely overlooked this thread.

All apologies. :ph34r:

However.... It DID solve my problem. :frantics:

Thanks a ton. And, again, sorry for the useless thread.

(However, since "disable multilingual description" was checked, I believed the description would be available for all languages. Oh, well. Nevermind. I'm just thick.)

Link to comment
Share on other sites

You're right that "disable multilingual description" should to that. But currently it seems, that this setting is only blocking the rendering of the fields in the backend.

Edit: Misread the file and just tested on a fresh 2.6 installation. It works, but only if it was never saved with multilingual descriptions enabled. Until it was saved once it will stay kinda multilingual. 

Added a github issue: https://github.com/ryancramerdesign/ProcessWire/issues/1161

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...