Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[TwigBundle] Give some love to exception pages#20525

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:fix-exception-page
Nov 16, 2016

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?3.2
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

Before:
before

After:
after

chalasr and ogizanagi reacted with thumbs up emoji

/**
* @internal
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

second argument should be typehinted as array IMO

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

done

@nicolas-grekasnicolas-grekasforce-pushed thefix-exception-page branch 2 times, most recently from7d249b0 to10b9db2CompareNovember 15, 2016 12:11
@javiereguiluzjaviereguiluz added this to the3.3 milestoneNov 15, 2016
@linaori
Copy link
Contributor

Are they opened by default? If so, can you add a limit of maybe 5 or 10 logs? I've had pages where there are 100+ logs and that will make it annoying to find the exception.

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedNov 15, 2016
edited
Loading

@iltar this PR is about fixing this page, ie make it work again; not about making it better. We could (and should) work on that for 3.3. But this one is a bug fix (placeholders are not replaced right now, and CSS needs a fix in the code block excerpt).

@fabpot
Copy link
Member

I mis-read the code as well. 👍

@fabpotfabpot modified the milestones:3.2,3.3Nov 15, 2016
@linaori
Copy link
Contributor

Ah my bad, I only saw new code 😆


for ($i =max($line -$srcContext,1),$max =min($line +$srcContext,count($content));$i <=$max; ++$i) {
$lines[] ='<li'.($i ==$line ?'' :'').'><divid="line'.$i.'"></div><code>'.self::fixCodeMarkup($content[$i -1]).'</code></li>';
$lines[] ='<li'.($i ==$line ?'' :'').'><aname="line'.$i.'"></a><code>'.self::fixCodeMarkup($content[$i -1]).'</code></li>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

a[name] is not valid HTML5... what about<li><code></code></li> As anchor linking will work on any ID anyway...

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

There can be only one specific id on a page, yet this is called several times.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Maybe add a static counter internally? To create something unique..

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If the target is not predictable, we're going to have a hard time linking to it...

Copy link
Contributor

@ro0NLro0NLNov 15, 2016
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I see. Maybe generate a hash of file+line.. or something, and only add a unique prefix for the 2nd and upcoming instances (ie. the first instance is predictable).

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

a with name works, let's not create a pile of code to solve no actual issue...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Imo. it should produce valid HTML5 :).. but fair enough.

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commitd8e9b6c intosymfony:masterNov 16, 2016
fabpot added a commit that referenced this pull requestNov 16, 2016
…ekas)This PR was merged into the 3.2-dev branch.Discussion----------[TwigBundle] Give some love to exception pages| Q             | A| ------------- | ---| Branch?       | 3.2| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Before:![before](https://cloud.githubusercontent.com/assets/243674/20304174/e4e0f492-aafc-11e6-8ca4-c76bea856f7a.png)After:![after](https://cloud.githubusercontent.com/assets/243674/20304178/e8dcaae6-aafc-11e6-87a0-567be498fc6e.png)Commits-------d8e9b6c [TwigBundle] Give some love to exception pages
@fabpotfabpot mentioned this pull requestNov 17, 2016
@nicolas-grekasnicolas-grekas deleted the fix-exception-page branchNovember 18, 2016 21:21
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

+1 more reviewer

@ro0NLro0NLro0NL left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.2

Development

Successfully merging this pull request may close these issues.

7 participants

@nicolas-grekas@linaori@fabpot@stof@ro0NL@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp