Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alignment not working with default style array #3456

Closed
1 of 8 tasks
SantiagoToledo opened this issue Mar 15, 2023 · 1 comment · Fixed by #3459
Closed
1 of 8 tasks

Alignment not working with default style array #3456

SantiagoToledo opened this issue Mar 15, 2023 · 1 comment · Fixed by #3459

Comments

@SantiagoToledo
Copy link

SantiagoToledo commented Mar 15, 2023

This is:

- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Set default style to alignment to spreadsheet.

What is the current behavior?

Ignoring default style. Its currently ignoring horizontal and vertical alignment. And also ignoring wrap property

What are the steps to reproduce?

It stoped working going from v1.27.0 to v1.28.0

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$styleArray = [
	'alignment' => [
		'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
		'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
		'wrapText' => true,
	],
];
$spreadsheet->getDefaultStyle()->applyFromArray($styleArray);

What features do you think are causing the issue

  • Reader
  • Writer
  • Styles
  • Data Validations
  • Formula Calculations
  • Charts
  • AutoFilter
  • Form Elements

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

Which versions of PhpSpreadsheet and PHP are affected?

php 7.4.32
PhpSpreadsheet v1.27.0

@oleibman
Copy link
Collaborator

Confirmed, regression due to PR #3372. Fix available shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants