Drupal renaming files already in system - drupal-7

I've added quite a few images into the drupal system.
Now I've had to rename them.
I've renamed all the images and added them into the default/files folder and ran a script to update all of the files names within the file_managed table. This is both in the filename and uri.
However the changes are visible within admin portion of the site but not the front end.
If I go into the admin and to that content item and do nothing apart from save it, the changes are thn visible on the front end.
Any help with what I need to do to force it would be great.

Try clearing the cache for the entire site at admin/config/development/performance

Related

Adding local image in Jupyter SQL notebook

Started using Azure data studio and creating documentation for some SQL processes in our system.
As part of that I need to include a flow diagram in the document. Currently I have uploaded an image to a URL and am able to embed the image in document from the URL.
But is there any way to include an image from a local folder? Please assist.
I think this is what you want.
from IPython.display import Image
Image(filename='C:/your_path/your_image.PNG',width=200, height=100)
I was interested in this also. Syntax should be (if you store images in subfolder relative to notebook):
![ssms_subquery](images/16_ssms_subquery.png)
This didn't work for me initially: rendered as a broken image icon.
Things I tried:
Make sure you have a workspace defined for your root folder. Create the folder, then select "File > Add Folder to Workspace ..."
If that does nothing, try closing and restarting ADS. I've found the rendering to be flaky from time to time after awhile or if you have been opening/closing notebooks a lot.
Related topic has been discussed previously for markdown in general (but worth asking again for ADS!), eg. How to display local image in markdown

How to solve local caching?

My question is the next:
Situation:
I have an ImagesScreen where I can upload some additional photos, delete them, etc.
When someone add a new photo (from the gallery, react-native-image-crop), I want to make a copy from the image, save it to the local storage (so even if someone delete the image from the gallery I got my own copy in my local storage).
Why:
I do not want to immediately send the photos toward the API, I just want to backup them every day, so when I make a copy from the selected photo(s) I want to retrieve the uri of the local stored image. (not the uri of the image in the gallery)
How would you guys handle this case?
its complicated, try https://github.com/itinance/react-native-fs, is suitable for you.
there you can handle cached dirs, tmp dirs, delete files/save files

Drupal - Site transfer. Change absolute URLs in the database?

I have content in drupal (Blocks, Pages etc.) where absolute links have been inserted. I moved the site and the urls in the blocks and pages are still pointing to the old domain.
How can I change this in the database? Which database table do I need to target? I want to do something like:
UPDATE table SET content = REPLACE(content,'www.domain.com/old','www.domain.com/new');
Thanks!
Drupal it self is not using absolute paths (like i.e. WordPress does) so moving "common" Drupal websites doesn't require any intervention like this.
My advice is to always use root relative paths for internal links.
Basically you would have to replace ALL appearances of old domain with new one, so it would be best to export your database to sql file, do search/replace on that sql file and then import changed dump file to new domain database. Maybe clear all the caches before database export to reduce database size...
Backup your database first!
Install Adminer script and search whole database for previous (old) domain name. Or build SQL-query to search all tables if you like command line interface
See How to search and replace all instances of a string within a database? to know how to replace string in whole database.
Making this change to the database may not be the best practise, why don't you instead try using the base html tag within the head tag in the .html template file:
<head>
<base href="http://www.domain.com/new"
</head>
Refer to for more information on this tag: http://www.w3schools.com/tags/tag_base.asp

How to I access the template that DotNetNuke uses when creating new pages?

I recently applied a new skin to one of our existing DotNetNuke CE sites. The upgrade of the site worked, but when I add a brand new page (not imported) to the site there are some issues.
DotNetNuke attempts to copy content from my Slogan Pane, and Top Pane when I add a new page. However, it creates multiple copies of each (about 25 of each module in each Pane). I then have to take my new TabID, go into the TabModules table, and manually delete the duplicate rows to get the new page correct.
I am sure there is a template file somewhere that DotNetNuke is utilizing to create new pages. I hope to be able to modify this file to stop the problem or point DNN to a different file to use for default page creation. Does anyone happen to know where this template is? Barring that, is there any way to interrupt/modify the new page process (without source code mod) to fix the issue?
Thank you
Page Templates are stored in the Portals/# folder, where # is the ID of the folder. They can be within ANY folder inside of there, so you might have to dig around a little bit.
I would guess that you perhaps created a page template, and it has the 25 modules in it, but you also have those modules set to "display on all pages" so that is where the duplication comes from.

How do I use VBA to obtain the file path to a shortcut from which the ActiveDocument was launched?

I am building a document management system. In each subdirectory within the main document repository, there is a shortcut to a document template. When a user wants to create a new document, he/she navigates to the appropriate subdirectory for the document and clicks the shortcut.
When the user clicks the shortcut, MS Word is launched, showing the new document based on the template. When the user clicks Save, the document will normally be saved to the current directory which will be the default location for new documents specified in Word Options.
I want the current directory of a new document to be the same as the directory of the shortcut from which it was created. The user has already decided where the document is to be located by navigating to the appropriate subdirectory and clicking the shortcut. It should not be necessary for the user to navigate to the same location again within the Save As... dialog.
If I can obtain the path to the shortcut, I can programmatically save the document to the same directory or a new subdirectory.
Also asked on MSDN VBA Forum and on VBA Express.
I don't think you're going to be able to do this without doing some awful hacking around trawling the file system (I had a brainwave about the "Start in" property of the shortcut, but sadly that didn't work).
Unfortunately I think the best solution may be to get rid of the shortcuts and just have lots of copies of the document template lying around.
Chris
Maybe this?
Public Sub OriginalPath()
Debug.Print TemplateProject.ThisDocument.Path
End Sub

Resources