Fixed Setup > Advertising - error on save

woody

Well-known member
Affected version
2.0.11
Error occurs every time I attempt to save an Advertisement, even if the ad code is left blank. Issue is on my dev/test site, zero plugins installed.

XF\PrintableException: Line 13: Expected valid expression. - Template name: public:_ads in src/XF/Mvc/Entity/Entity.php at line 1105
  1. XF\Mvc\Entity\Entity->save() in src/XF/Service/Advertising/Writer.php at line 84
  2. XF\Service\Advertising\Writer->write() in src/XF/Repository/Advertising.php at line 70
  3. XF\Repository\Advertising->writeAdsTemplate() in src/XF/Entity/Advertising.php at line 37
  4. XF\Entity\Advertising->XF\Entity\{closure}() in src/XF.php at line 245
  5. XF::triggerRunOnce() in src/XF/Mvc/Dispatcher.php at line 137
  6. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  7. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  8. XF\App->run() in src/XF.php at line 329
  9. XF::runApp() in admin.php at line 13
 
Corrected: I had copy/pasted ad code from XF1 into each ad slot. Upon initial save, the code DID save into the _ads template....and then future save attempts "broke" the process.

May wish to ensure that Advertising code meets formatting prior to allowing it to save.
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XF release (2.0.12).

Change log:
Validate advertisement html before saving.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom