Print as PDF not working with PHP 8.1 Version 7.14.6

Hi everyone, in case you still need a fix on upgrading old instances, we made it working thanks to:

in

modules/AOS_PDF_Templates/PDF_Lib/mpdf.php

around line #22339, susbtitute

				// Update nestedpos row references
                if (count($this->table[($this->tableLevel+1)])) {
                    foreach ($this->table[($this->tableLevel+1)] as $nid=>$nested) {
                        $this->table[($this->tableLevel+1)][$nid]['nestedpos'][0] -= count($temptf);
                    }
                }

with

				// Update nestedpos row references
				$nextTableLevel = $this->tableLevel + 1;

				if (!empty($this->table[$nextTableLevel]) && is_countable($this->table[$nextTableLevel])) {
					foreach ($this->table[$nextTableLevel] as $nid => $nested) {
						$this->table[$nextTableLevel][$nid]['nestedpos'][0] -= count($temptf);
					}
				}
2 Likes