Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Show the file UUID instead of binary data #6257

Closed
xchs opened this issue Oct 2, 2013 · 8 comments
Closed

Show the file UUID instead of binary data #6257

xchs opened this issue Oct 2, 2013 · 8 comments
Labels
Milestone

Comments

@xchs
Copy link
Contributor

xchs commented Oct 2, 2013

[Contao 3.2.beta1]

If you open the details for a database record (e.g. a content element) you may find a row for the "Source file" showing the file unique ID as binary data.

details

Since this is actually no useful information for a back end user I would suggest to convert the binary data to an UUID string in the DC_Table driver:

String::binToUuid(...)
@tristanlins
Copy link
Contributor

👍

@leofeyer
Copy link
Member

leofeyer commented Oct 2, 2013

Fixed in 10304da.

@xchs
Copy link
Contributor Author

xchs commented Oct 2, 2013

Not quite sure if it has to do with your commit but I suppose it is at least related: if you open the details for a back end user record you'll get the following warnings:

Warning: unpack(): Type H: not enough input, need 4, have 0 in system/modules/core/library/Contao/String.php on line 551

#0 [internal function]: __error(2, 'unpack(): Type ...', '/var/www/virtua...', 551, Array)
#1 system/modules/core/library/Contao/String.php(551): unpack('H8time_low/H4ti...', '')
#2 system/modules/core/drivers/DC_Table.php(501): Contao\String::binToUuid(NULL)
#3 system/modules/core/classes/Backend.php(424): Contao\DC_Table->show()
#4 contao/main.php(129): Contao\Backend->getBackendModule('user')
#5 contao/main.php(276): Main->run()
#6 {main}


Warning: implode(): Invalid arguments passed in system/modules/core/library/Contao/String.php on line 551

#0 [internal function]: __error(2, 'implode(): Inva...', '/var/www/virtua...', 551, Array)
#1 system/modules/core/library/Contao/String.php(551): implode('-', false)
#2 system/modules/core/drivers/DC_Table.php(501): Contao\String::binToUuid(NULL)
#3 system/modules/core/classes/Backend.php(424): Contao\DC_Table->show()
#4 contao/main.php(129): Contao\Backend->getBackendModule('user')
#5 contao/main.php(276): Main->run()
#6 {main}

@tristanlins
Copy link
Contributor

I think Contao\String::binToUuid() cannot handle empty input ;-)
See stack trace call # 2

@leofeyer
Copy link
Member

leofeyer commented Oct 3, 2013

Fixed in b7f6343.

@lindesbs
Copy link

Stil open.

Copy an image to another name.

for example cp files/music_academy/layout.gif files/music_academy/layout2.gif

Synchronize the filesystem.

In the database both files are available. Both files have the same hash file "ec5793c27e75e0426a69202d876733e2"

But only one of them has the uuid.

The others file uuid is "NULL".
So, in DetailView i get this warning:

Warning: unpack(): Type H: not enough input, need 4, have 0 in system/modules/core/library/Contao/String.php on line 551

#0 [internal function]: __error(2, 'unpack(): Type ...', '/var/www/client...', 551, Array)
#1 system/modules/core/library/Contao/String.php(551): unpack('H8time_low/H4ti...', '')
#2 contao/popup.php(120): Contao\String::binToUuid(NULL)
#3 contao/popup.php(193): Popup->run()
#4 {main}


Warning: implode(): Invalid arguments passed in system/modules/core/library/Contao/String.php on line 551

#0 [internal function]: __error(2, 'implode(): Inva...', '/var/www/client...', 551, Array)
#1 system/modules/core/library/Contao/String.php(551): implode('-', false)
#2 contao/popup.php(120): Contao\String::binToUuid(NULL)
#3 contao/popup.php(193): Popup->run()
#4 {main}

@xchs
Copy link
Contributor Author

xchs commented Oct 25, 2013

This is what I get on my system (Contao 3.2.RC1 / latest develop branch):

sync
db

@leofeyer
Copy link
Member

I cannot reproduce this either. Did you check with version 3.2.RC1 or beta2?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants