We refreshed my development server from my quality server. We used a database backup of the quality database and restored it to a different SQL Server. I copied the .Net code to my development website location. After making adjustments to environment variables to set it up as Development, I didn't notice any issues. I proceeded with patching from version 7.0.24 to version 7.0.84. I proceed with some changes to my pages. When testing them, I noticed that the macros in the properties of the web parts do not appear to be executing on the Live Site. However, the preview site was executing without issue. I reenter a couple of the macros to see if it would resign them. When viewing the live site, they still didn't work. I went to the Administration>System>Macros tab on the Site Admin site. I entered my old connection string and checked Sign all Macros and Use Current Salt. I then clicked update macro signatures. I view the Live site and they still do not appear to work. The Preview site still shows they are working. There are no objects, pages, or templates checked out. So I turned on debugging for macros. I notice that the macro is executing but not returning the proper values.
The macro that I am using is {%CurrentDocument.DocumentsOnPath[2].DocumentName#%}
I added {%CurrentDocument.DocumentsOnPath.Count#%}
to the same display area and it comes back as 0.
The tree is similar to below. The macro is on the master page set on the "Mobile" page. Brochure inherits the master page.
Root
-Mobile
--Brochures
---Brochure 1
---Brochure 2
---Brochure 3
---Brochure 4
I also added {%CurrentDocument.AliasPath#%}
and it returns "/Mobile/Brochures" so I know it is picking up the right document name.
I am confused on why this would work in preview and not in live site if all pages are checked in and have the green dot showing they are published.
Also, if you jump back and forth between live site and preview site (using the close button on preview site and the Live site link in the Site Manager), it suddenly works for that page. Then when I view it on another device, it works for that page but no other until I clear the cache.
The quality site that this environment was copied from shows that the macros are executing and returning the values correctly consistently.