Forum
Problem with assets since upgrade
We have just updated from 9.05 to 9.09
We use redactor as editor for text block. The problem relates to the blog app.
However if we click on insert image the assets modal shows no images found.
We then click on the by bucket tab, we see list of buckets. We can see assets in most of the buckets but any that have a space in the their name show as blank i.e they list no assets. We have checked and the buckets exist and do have assets in them. I think previously it would have opened the bucket as defined in the template as the default asset folder
This used to work prior to upgrade can you help or advise , possible cause,
<perch:blog id="postTitle" type="text" label="Title" required="true" size="xl autowidth" order="1" />
<perch:blog id="excerpt" type="textarea" label="Excerpt" markdown="false" order="2" suppress="true" size="s" help="The excerpt is a short sentence that briefly summarises the article content on the article listing page. It is not displayed within the article post itself." required="true" />
<perch:blog id="postDescHTML" type="textarea" label="Article Body" order="3" editor="redactor" html="true" size="xxl autowidth" required="true" />
<!-- Largest size - for Article View & OpenGraph -->
<perch:blog id="image" type="image" label="Article image" width="580" height="320" crop="true" order="4" bucket="News" notes-before="For a standard article, an image size of 300x320px is recommended. For a featured article, a larger image size of 580x320px is required." help="300x320px for standard article OR 580x320px for featured article." />
<perch:blog type="checkbox" id="featured" label="Featured Article" value="true" help="Select this box if the article is a featured article." />
<perch:blog id="postDateTime" type="date" label="Date" time="true" format="Y-m-d H:i:s" divider-before="Publishing" />
<perch:blog id="postURL" type="hidden" />
<perch:categories id="categories" set="blog" label="Categories">
<perch:category id="catSlug" type="slug" />
<perch:category id="catTitle" type="text" />
</perch:categories>
Buckets can't have a space in the name.
They did before ?, and worked . So what is the recommended procedure to fix.
If it worked before, it was down to luck - a bucket is a folder on the file system. You wouldn't put a space in a folder name within a website, so the same applies to buckets.
I'm not sure how you'd rectify it now. I'll have a think.
That makes sense , however the bucket was declared in the template and perch automatically created the folder. It wasn't noticed till the upgrade and it broke. Ill await your suggestions .
OK some supplemental information.
rolled back to before upgrade
We have buckets named as follows : 'Bucket One', 'BucketTwo', Bucket Three', Default...etc
When we use the assets we can view assets in all the buckets, including all buckets with spaces in the names. However if we use the blog app and try to insert an inline image via redactor the assets modal opens, it says nothing found and if we then go to 'by bucket' tab and select a tab we see assets in ONLY in the buckets without names. So there is an inconsistency .
I can send a a video link if the above is confusing Drew !
It's because the
bucket
attribute is a space-delimited list. So if you have bucket calledBucket One
that is read as two buckets; one calledBucket
and one calledOne
.Here is an idea... but wait for Drew to verify...
Why not create additional buckets with same names but use an underscore or "dash" in place of the spaces.
Then..... oh my gosh I am about to say something not for the faint of heart.... do a search and replace of assets in the database updating the bucket names to the newly created names.
The only really crazy failure I can see is any regions with assets which are cached would likely be broken (unverified) but the search and replace should also fix this issue too.... (maybe)
One last warning, you could potentially lose the undo feature going backwards, but should be fine moving forward... (again, un-verified)
I am going to do a little looking into this but I would say Drew is the final word here as my idea is just that, an idea.
Drew, I understand your answer thanks. Very strange though that the buckets display OK via Assets, but not if you use redactor , which looks like it just uses Assets interface but in a modal form , I would have thought the interface would use the same code?
Robert, we had the same ideas here, about renaming the folders and then performing SQL search and replace on the DB, but probably need a guide from Drew so we make sure we get all areas of the DB that would be concerned. Undo is not an issue for us, as there site is a pre-launch, this was found in final testing.
Drew can you advise please?
Robert - please do not suggest people search and replace through their database. We cannot support anyone who has done this as the likelihood of data inconsistency is too high. We could end up chasing our tails burning up time better spent on developing Perch, trying to fix a "bug" based on inconsistent data.
Thanks Rachel - we are just trying to find a solution to the problem. :-) Any suggestions for a fix ?
Rachel, it is with extreme hesitation that I suggest anyone to touch the database, and I point out this is not something that should be taken lightly. In some cases, working in the database is the only way to repair things. I am sorry if this has upset you, I do try to make sure people know it's highly frowned upon.
@robert It's not "highly frowned upon", if people do it then we can't help them further in support. Do not in future use the forum to suggest people modify their database as it is going to upset people if we tell them we can't help further, when they take your advice in good faith. I don't want to have to moderate you, as I know you are trying to help people, but we will need to if we feel people are going to be led into actions that cause them problems down the line.
@Gary - Drew is travelling today (as am I - I'm in Heathrow airport and not really in a position to do anything useful) I'll make sure he sees this thread once he is online.
The reason it's different in the Assets app, despite using the same code, is that the Assets app is not reading a
bucket
attribute from your template. As explained, that attribute is space-delimited.Possibly the medium term solution is to provide an escape character so that you can continue with your buckets with the spaces in the names. Until that is available, you'd be best to stick with the prior version and not update.
Understood
Drew
Thanks that is clearer now, just for clarity, you are working on a 'medium term' fix (do you have approx timescale), so we can upgrade when that comes around ?
What caused us to want to upgrade was a'bug' in redactor/assets that when inserting an inline image , we would click on the point we wished to insert image , however when we added the asset the short code got inserted at the start of the field rather that the selected insertion point .
We are using the latest version of Chrome.
I'll certainly have a look to see if that's going to be possible to implement.