• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Edit backup XML in text editor

Edit backup XML in text editor 9 years 2 months ago #34097

  • john.hubickey
  • john.hubickey's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Thank you received: 2
I was hoping I could speed up and simplify a complex form creation by exporting the form, editing the XML create a new tgz and restoring.

All I did was use regex in a plaintext editor to change the names and labels of duplicated fields (lots of those).
When I duplicated the fields it added "copy" to the name. I simply replaced " copy" with correct text for field names, making sure each was unique. I checked and verified the file was correctly formatted.

I keep getting an error:
Error Attempted to extract a file with invalid characters in its name. Temporary files removed.
Is this indicating errors in the file? Or is this errors with the tgz compression?

I am on a max using terminal to tgz the files. I am compressing the same files that were in the back up:
e4da3b7fbb.xml
metadata.xml

I assume the first file has a generated file name/ID for that form and the second file is additional information for the form.
The administrator has disabled public write access.

Edit backup XML in text editor 9 years 2 months ago #34120

  • john.hubickey
  • john.hubickey's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Thank you received: 2
I don't know if this is an error in RSFP backup/restore or not.

In the file:
/administrator/components/com_rsform/helpers/restore/restore.php

I commented out the Exception when checking for invalid characters in the file name:
// Make sure file does not contain invalid characters
if (preg_match('/[^a-z_\-0-9]/i', JFile::stripExt($meta['filename']))) {
	//throw new Exception('Attempted to extract a file with invalid characters in its name.');
}

Which file name is it checking? The tgz file or the files in the archive? Why would the filename throw an error? Why is my edited tgz archive causing filename issues when there are none?

Removing the Exception allows me to import an edited XML of the backup which means there's nothing wrong with the edited restore file I created.
I think there is something odd going on here but I don't know exactly what it is. It certainly feels like an error or bug to me since making this change allows me to import without any issue. The form loads in fine and works great with my external edits. The file names are identical to the original. I made sure to gzip without any hidden or odd mac files using terminal.
There are no odd characters in the file itself.
The administrator has disabled public write access.
The following user(s) said Thank You: xsbucks

Edit backup XML in text editor 9 years 2 months ago #34127

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Without actually having a look at the backup there isn't much insight that i can provide. The check is in place especially for Mac users as there are some automated extra (hidden) files that are being generated. As you can imagine attempting to use those files within the restore process would cause errors.
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Edit backup XML in text editor 9 years 2 months ago #34132

  • john.hubickey
  • john.hubickey's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Thank you received: 2
Yes, the "hidden mac" files was my first thought. So I used mac terminal to compress without any files except those for the backup (there's an option to not create or copy hidden files on mac).

I am able to make do with what I have for now. I have a local joomla installation using Mamp with RSFP. I commented out that line so I can import my edited form. Then I export it again so it can be imported to unmodified versions of RSFP.

I will do more research on Mac gzip to make absolutely certain it isn't adding anything strange. I am not an expert with the various versions of tar.gz and .tgz so it could be mac does something "odd".
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!