mirror of
				https://github.com/getgrav/grav-plugin-admin.git
				synced 2025-10-31 10:25:50 +01:00 
			
		
		
		
	Fix for visible state when creating new pages #1831
This commit is contained in:
		| @@ -3,6 +3,7 @@ | |||||||
|  |  | ||||||
| 1. [](#bugfix) | 1. [](#bugfix) | ||||||
|     * Fixed parent field not working with regular pages |     * Fixed parent field not working with regular pages | ||||||
|  |     * Fixed visible state being lost when creating new pages [#1831](https://github.com/getgrav/grav-plugin-admin/issues/1831) | ||||||
|  |  | ||||||
| # v1.10.0-rc.7 | # v1.10.0-rc.7 | ||||||
| ## 03/05/2020 | ## 03/05/2020 | ||||||
|   | |||||||
| @@ -1848,7 +1848,7 @@ class Admin | |||||||
|                 $header = ['title' => $data['title']]; |                 $header = ['title' => $data['title']]; | ||||||
|  |  | ||||||
|                 if (isset($data['visible'])) { |                 if (isset($data['visible'])) { | ||||||
|                     if ($data['visible'] === '' || $data['visible']) { |                     if ($data['visible'] === '') { | ||||||
|                         // if auto (ie '') |                         // if auto (ie '') | ||||||
|                         $pageParent = $page->parent(); |                         $pageParent = $page->parent(); | ||||||
|                         $children = $pageParent ? $pageParent->children() : []; |                         $children = $pageParent ? $pageParent->children() : []; | ||||||
| @@ -1860,8 +1860,8 @@ class Admin | |||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                     if ((int)$data['visible'] === 1 && !$page->order()) { |                     if (in_array($data['visible'], ["0", "1"])) { | ||||||
|                         $header['visible'] = $data['visible']; |                         $header['visible'] = (bool)$data['visible']; | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|                 } |                 } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user