From Tafsir Al Qurtubi on 2:221
الخامسة ـ وٱختلف العلماء في منازل الأولياء وترتيبِهم؛
فكان مالكٌ يقول: أوّلهم البنون وإن سَفَلوا، ثم الآباء، ثم الإخوة للأب
والأُم، ثم للأب، ثم بنو الإخوة للأب والأُمّ، ثم بنو الإخوة للأب، ثم
الأجداد للأب وإن عَلَوْا، ثم العُمومة على ترتيب الإخوة، ثم بنوهم على
ترتيب بني الإخوة وإن سَفلوا، ثم المولى ثم السلطان أو قاضيه. والوصيُّ
مقدّم في إنكاح الأيتام على الأولياء، وهو خليفة الأب ووكيلهُ؛ فأشبه
حاله لو كان الأب حيّاً.
وقال الشافعي: لا ولايةَ لأحد مع الأب، فإن مات فالجد، ثم أبُ أبِ
الجَدِّ؛ لأنهم كلهم آباء. والولاية بعد الجد للإخوة، ثم الأقرب. وقال
المُزِنيُّ: قال في الجديد: من ٱنفرد بأُمٍّ كان أوْلَى بالنكاح؛
كالميراث. وقال في القديم: هما سواء.
قلت: وروى المدنيّون عن مالكٍ مثلَ قولِ الشافعيّ، وأنّ الأبَ أوْلى من
الابن؛ وهو أحد قولي أبي حنيفة؛ حكاه الباجيّ. ورُوي عن المغيرة أنه قال:
الجَدُّ أوْلَى من الإخوة؛ والمشهور من المذهب ما قدّمناه.
وقال أحمد: أحقّهم بالمرأة أن يزوّجَها أبوها؛ ثم الابن، ثم الأخ، ثم
ٱبنُه، ثم العَمّ. وقال إسحاق الابن أوْلىٰ من الأب؛ كما قاله مالكٌ،
وٱختاره ابنُ المنذر؛ لأن عمرَ بنَ أُمّ سلمة زوّجها بإذنها من رسول الله
صلى الله عليه وسلم. قلت: أخرجه النَّسائيّ عن أُمّ سلمة وترجم له (إنكاح
الابن أمَّه).
[ Below is my own paraphrased translation and it can have mistakes. ]
Fifth: The Ulema differ about the Awliyah and their order.
Imam Malik said: From the Awliyah, the first is the son, no matter how
much lower in line of descent he is. Then the father, then the brother
who is from both the father and the mother. Then the half-brother who
is just from the father, then the sons of the full brothers, then the
sons of the half-brothers, then the ascendants from the father, no
matter how removed they may be, then the owner [in case of a freed-slave?] then the sultan or
Qadi(judge) ... [omitted part about orphans]
Imam Shafi said: No one shares the wilayah with the father. If the
father dies then the grandfather, then the great-grandfather because
all of them are the fathers. After the grandfathers it goes to the
brothers, then to those who are nearer in relation to her. Mazni
related the newer saying of Shafi that those from the mother are more
eligible to be the wali, and the older saying is that they are both
equal.
I (Qurtubi) say that the people of Medinah have narrated from Imam
Malik a similar saying to that of Imam Shafi, that the father is more
eligible to be the wali than the son, and the same is one of the two
views narrated from Abu Hanifa. This is narrated from Albahi. It is
narrated from Mughira that he said: The Grandfather is more eligible
than the brothers. The popular view is the one narrated beforehand.
Imam Ahmad said: For the woman's nikah, the more eligible to be her
wali is her father, then son, then brother, then the son of the
brother, then the uncle (brother of father). Ishaq said: The son is
more eligible than the father: as Imam Malik had said, and Ibn Munzar
has adopted this since Umro bin Umm-e-Salmah married her with
his/her(?) permission to the Prophet. I say that Nisai has narrated
this from Umm-e-Salmah and given the title باب إِنْكَاحِ الاِبْنِ أُمَّهُ (A Son Conducting The Marriage For His Mother)
From Imam Nawawi's Minhaj Al Talibin, representing the Shafi school of thought:
The persons who hâve the right to assist a woman as guardian at her
marriage are first of all the father, then father's father, then his
father, then the whole brother or half brother on the father's side,
then the latter's son or other agnate descendant, then father's whole
brother or half brother on father's side ; and lastly the other
agnates in the order in which they are called to the succession, *it
being understood that a whole brother always has priority over a half
brother on the father's side.
A son, though the nearest agnate, cannot give his own mother in
marriage, since a right of guardianship does not pass into the
descendant line ; he can only do so if he is also son of the son of
his mother's father's brother, or by right as patron or as judge
representing the Sovereign.
In default of agnates in the ascendant or collatéral line, a woman
should be given in marriage by her patron, and after him by his
agnates in the order in which they are called to the succession. In
the case of an enfranchised slave who has no patron, but a patroness,
she should be given in marriage by the individual who in thèse
circumstances would be the guardian of the patroness, without the
latter's consent being necessary. After the death of the patroness,
the right of assisting the enfranchised slave as guardian devolves
upon the same person as does the patronage.
Lastly, in default of patron, or agnates of patron or patroness, it is
the Sultan who should assist the enfranchised slave who wishes to
marry, as guardian of all the women in his empire who hâve no other,
or whose guardian, whether agnate or patron, prevents the marriage by
abusing his power.
Also see related query on islamqa.info, seems to be from the Shafi perceptive:
If there is no father, then the grandfather is the wali. If there is
no grandfather then her brothers are her walis, and it is does not
matter if they are younger than her, but it is essential that the wali
be an adult. If one of her brothers is an adult then he is her wali,
even if he is younger than her. ...
If all her brothers are minors, and none of them is an adult, then the
role of wali passes to those who come next, namely the paternal
uncles. If there are no paternal uncles then it passes to the sons of
the paternal uncles (cousins).
If none of these walis are present, then the shar’i judge should act
as wali for her marriage, because the Prophet (peace and blessings of
Allaah be upon him) said: “If they dispute, then the ruler is the
guardian of the one who has no guardian.” Narrated by Abu Dawood
(2083) and al-Tirmidhi (1102); classed as saheeh by al-Albaani in
Saheeh Abi Dawood.