cannot change resource template after migration - modx-revolution

After migrating to a new server I have found that I cannot change template: page reloaded but the template remains the same as it was.
Have I forgotten to do something after migration?
Any suggestions?

There may be few reasons for this to happen but the most common and most likely to happen is the variance of the time interpreted by MODX and time that server is set to. This means that whenever document is edited, MODX caches its content and differentiates each of these cached files by timestamp. Once reloaded, MODX tries to retrieve the timestamp and compare it and if fails, it jumps the form content (including the template settings) to the previous settings.
The solution for that is to get the date.timezone setting from the server configuration and paste it into date_time setting in the MODX manager settings to make them equal. This should solve the problem right away but keep in mind that the cache cleanup(even manaual) may be needed.

Related

Workbox's service worker not updating when changed

Explanation
I'm having an issue with Workbox where my website doesn't update when a file's content is changed, unless I manually clear storage/site data in my browser.
Since v4 release this year, the cleanupOutdatedCaches, which is in my code, should take care of this, but the problem persists.
Example
I created this website to exemplify. Once you access it, Workbox will install the service worker, but if I change, for example, test1 to test2, you won't see the change, unless you clear the site data in your browser and refresh.
I also tried only unregistering the sw; it shows the updated version (test2), but when refreshing twice it goes back to the old version (test1).
You can see the website's code in GitHub here.
Thanks in advance,
Luiz.
cleanOutdatedCaches will only clean caches created by older versions of the workbox library. In this case, since you are using the same version fo workbox, the call to this method does nothing.
https://developers.google.com/web/tools/workbox/reference-docs/latest/workbox.precaching#.cleanupOutdatedCaches
Once a particular file is precached by Workbox, it will never attempt to retrieve that file from the network, unless the revision you have specified in the precacheAndRoute call is different from what was previously cached.
Since you changed index.html but not the revision in precacheAndRoute, workbox assumes the file is unchanged. So,what you need to do is to update the precacheAndRoute with a new hash that corresponds to the new version of index.html
You can achieve this by either using injectManifest
https://developers.google.com/web/tools/workbox/modules/workbox-build
or any other build tooling you use.
Edit:
You can invoke skipWaiting programmatically as well
https://developers.google.com/web/tools/workbox/modules/workbox-core#skip_waiting_and_clients_claim
But you do need to use it with caution. Here is one way to do it :
https://developers.google.com/web/tools/workbox/guides/advanced-recipes

typo3 website move to other domain - need help step by step

I just got a typo3 website and need to transfer to an other domain.
Is it enough to copy all the folders (except typo3temp?) to the new place?
First I just changed baseurl in ts but it didn't do anything..
Should I do anything with the database when it still on the same server?
In case your question is about "cloning" a complete TYPO3-system an rsync/copy of the whole folder (yes including typo3temp) is the best idea, as this works on all versions, everything else (like excluding typo3temp) depends a whole lot on your TYPO3 expertise to resolve. The database needs to be copied as well. If you need to change db-name or db-credentials on the new system you need to change them in
typo3conf/LocalConfiguration.php
As soon as you have done this Install Tool and Backend should work: At first try the Install Tool:
https://my.new.domain/typo3/install/
If that doesn't work your problem is with the webserver configuration or dns.
If that works (and the reports there show no errors), try the Backend:
https://my.new.domain/typo3/
In case your question is about which changes are necessary to your TYPO3-installation if domain changes and the web server itself is configured correctly, then there are probably two things you need to change, in order to make the frontend work (although both cases might be omitted, depending on your configuration):
sys_template record, if any of those use absRefPrefix or baseurl. If you have access to the MySQL-Database a
SELECT pid FROM sys_template WHERE config LIKE "%baseurl%" OR "%absRefPrefix";
might help finding the template, however these template configuration might also be stored in files (typically in fileadmin/templates/**)
sys_domain records, a MySQL
SELECT pid FROM sys_domain;
might uncover where those are stored
However these changes are only necessary to enable the frontend to work.
Add a domain record in the backend. And while you don't need the content of the typo3temp folder, make sure the folder actually exists.
When you go to the new domain name in your browser, what happens?
Do you get redirected to the old domain? If so, maybe there is an .htaccess redirect happening.
Do you get to the new domain, but if you click on a link end up on the old one?
Do you get an error? If so, what is the error?
Does something else happen?

ModX Revo: Update sites base URL?

I developed a site for a client before a domain name was chosen. As a result, the URLs for the site pages look like:
http://host.mynost.net/~tempname/index.php?id=8
A domain name has now been purchased but if I click on any Wayfinder links it still uses the old path as above instead of, say:
http://domainname.com/index.php?id=8
I assume this is configured in the config.inc.php file, but I am unsure of what to change.
Can anyone point me in the right direction? Thanks!
You need to change $modx_base_url= '/' in /core/config/config.inc.php and if that is not enough - manually clean /core/cache/ folder.
Four years later, I've dealt with the same thing for a few months, and was incredibly frustrated.
An updated answer to this issue would be navigating to Settings (icon) > Context, then choosing Key > web (right click) > Update Context > Context Settings.
Change http_host (ex. localhost) and site_url (ex. http://localhost/).
Now, from the top menu Manage > Clear Cache as well as Manage > Clear Cache > Refresh URIs.
It was like finding a pot of gold.
I have a web on some super-old Modx version which I needed to temporarily set up for viewing, and I ran into this issue.
The way I changed the base URL is in the database:
table: modx_context_setting
key: site_url
This outlines how to move modx to a new location ~ which is essentially what you have done.
http://rtfm.modx.com/display/revolution20/Moving+Your+Site+to+a+New+Server
genereally you can get away with updating the config.inc.php & clearing the cache, but it's a good idea to go through the system setting table in the db looking for old paths, some packages do store path info in there.

Umbraco says it's saved changes to templates but the changes are lost

Each time I make a change to an Umbraco template and press Save, I get the confirmation popup saying:
Template saved
Template saved without any errors!
However, when I return to that template (click on another template and then back again), the changes have been lost.
I've ensured that the user account running my IIS application pool has Full Control over the \Views folder containing the .cshtml files (i.e. the Umbraco templates).
Strangely this just started happening, after it had been letting me make template changes with no problems. I can manually edit the .cshtml files on disk, but this seems ridiculous.
Any ideas?
A couple of things:
1) Have you checked that the following Windows accounts have full permissions for all folders "IUSR", "IIS_IUSRS", "NETWORK SERVICE" ?
2) Probably not but I have had problems in the past with caching. Have you disabled (set from True to False) caching properties in /config/umbracoSettings.config ? This should always be done during development.
OK, I'll provide an answer for others' future reference (although the reasons are unclear to me). It appears the change I was making to my Template must've been deemed invalid by Umbraco - when I strip the template text down to just a single, empty div and save it, the change is persisted successfully.
The confusing thing is that Umbraco provides no feedback as to why it's not saving - in fact it tells you that it HAS saved successfully.
Bizarre and confusing.
Just been editing my templates and got this problem. Fixed it by doing the following:
sign out of umbraco
clear your browsing data
sign back into umbraco
always be sure to copy and paste your code somewhere to keep it safe, and it can be easily pasted back in. Seems like a bug to me... but it saved after I did that.
(Using Umbraco 7)

Struts dev.mode for a live site

In the struts documentation they are saying that by setting
<constant name="struts.devMode" value="true" />
This will cause the site to load fastly.
So my question is is it possible to put this constant in live site so that it will load the live site fastly. Is there any problem with that?
Thanks
You took it all wrong,struts.devMode when enabled, acts much friendlier, which can significantly speed up development.
When you have made the devMode=true in your config file this will help you in following steps
Struts 2 will reload your resource bundles on every request (meaning you can change your .properties files, save them, and see the changes reflected on the next request).
It will also reload your xml configuration files (struts.xml), your validation files, etc, on every request. This is useful for testing or finetuning your configuration, without having to redeploy your application every time.
it will raise the level of debug or normally ignorable problems to errors.
In Short it is a weapon for the developer for enhance his development process by figuring out any error, as when enabled it will show yo much friendly and detailed error underlying the cause and any suggestion.
Here are more details for devMode
Struts2 Development mode
It is never recommended to enabled this in your production as enabling this means you are reloading your configuration file /any other property files on each request which will definitely slow down the overall portal.
By default, the development mode is disabled, because it has a significant impact on performance, since the entire configuration will be reloaded on every request.
The development mode is only suitable in a development or debugging environment. In a production environment, you have to disable it. It will cause significant impact on performance, because the entire application configuration and properties files will be reloaded on every request and extra logging and debugging information will also be provided.

Resources